View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Hutchins Tom Hutchins is offline
external usenet poster
 
Posts: 1,069
Default Create a textbox that displays a list of possible items as we type

Instead of a textbox, why don't you use a listbox or combobox? Execute a
query against the database to get the entire set of valid entries for the
control. Cycle through the query's output & add the records to the combobox
(.AddItem). Set the MatchEntry property of the combobox to
FmMatchEntryComplete to get the kind of progressive autocomplete behavior you
described.

Hope this helps,

Hutch

"sam" wrote:

Hi All,

Is it possible to display a list once user starts typing a word in vba?

For eg, I have a userform connected to access database(I can already pull
info from access, based on what user inputs in ID field), So Once a user
starts typing
in a text box, lets say User Name textbox, a list of users is displayed
(something like google search, we start writing in the search bar and it
suggests us what we might want based on what text we input)

SO if I type in "A" in User Name text box, I get all the names starting with
"A" such as:

Name: [ A.... ]
Aaron
Aber
Acron

If I type in a number, "2" I get the list of phone numbers starting with 2
and so on.

Can this be done in VBA?

Hope I made it clear.

Thanks in Advance