Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Mar 2004
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Userform Help (VBA/Excel/Y2k3)

    I need to pull records from an Access DB. I would like to be able to type part of the name in a text box for example and have VBA match what I'm typing to the nearest name in the DB (like the Address Book in Outlook) and have the match highlighted in a listbox (that contains all names). Can this be done in a userform? I can use ADO to pull the data into a listbox, but there are a lot of names and so I would prefer a method by which I can narrow down the search. Thanks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Userform Help (VBA/Excel/Y2k3)

    If you already have the names in a list box, set the MatchEntry property of the list box to 1 - fmMatchEntryComplete. As the user enters the initial characters of the name, the first name matching these characters will be highlighted.

  3. #3
    2 Star Lounger
    Join Date
    Mar 2004
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Userform Help (VBA/Excel/Y2k3)

    Thanks Hans. Is there a way to link what I type in a textbox with its corresponding (or close match) listbox value?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Userform Help (VBA/Excel/Y2k3)

    Why don't you use a combo box - it combines a text box and a dropdown list box in one control.

  5. #5
    2 Star Lounger
    Join Date
    Mar 2004
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Userform Help (VBA/Excel/Y2k3)

    I was trying to make the process harder than it needed to be. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •