Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having a Combo Box drop down after entering a few digits

Status
Not open for further replies.

ImStuk

Technical User
Feb 20, 2003
62
US
I have a combo box that displays a lot of data to search when I am entering characters in it. I need a way to enter a few characters, then the combo drops down and displays only the items that begin with those characters. I'm hoping to speed things up a bit. For example...I have a Zip Code table that has 40,000 + Zip Codes in it. I want to type "921" then have the combo dropdown and display only zip codes that start with 921...thanks for any help. I would imagine I have to have the Row Source kick in after the third character somehow.
 
Have you tried to play with the AutoExpand property of the ComboBox object ? In conjuction with the LimitToList property and the Dropdown method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
How are ya ImStuk . . . .

PHV is correct! Only way your gonna do this without additional coding!

Calvin.gif
See Ya! . . . . . .
 
Actually, AutoExpand only causes the text box portion of the combo box to be filled. It has nothing to do with the dropdown list.

The only method I've found is to use the KeyPress event...

Private Sub cboZipCodes_KeyPress(KeyAscii As Integer)
Me.cboZipCodes.Dropdown
End Sub



Randy
 
randy700, I just said that the behaviour of the AutoExpand feature has dependencies with LimitToList and Dropdown.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
ImStuk . . . . .

With code, you can detect the first three keys and then set [blue]dynamic criteria[/blue] for an SQL used as the [blue]RowSource[/blue].

Calvin.gif
See Ya! . . . . . .
 
And what about the BackSpace key then ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
How are ya PHV . . . . .

Using the Change Event: [purple]Len(cbxName.Text & "") = 3[/purple], would be the main trigger. Of course some numeric validation needs to be performed . . . . .


Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top