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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combobox with a partial mach search ?

Status
Not open for further replies.

vdzr

Technical User
Mar 6, 2003
42
DE
If i enter a peace of the name i'm looking for into the combobox, i want the pul down let me show the partial mach names

bv. *meul*

has to gif a pull down like

van der meulen Willem
meulenaere Jef
de meule Jan
 
I have a achieved similar using a textbox and a listbox / combo box. Using the textbox input to filter the list using the lists RowSource property.

eg.

Private Sub txtName_AfterUpdate()
lstNames.RowSource = "SELECT tblName.NameID, tblName.Name " & _
"FROM tblName " & _
"WHERE tblName.Name LIKE '*" & txtName & "*';"

End Sub

This may help with your ideas.

There are two ways to write error-free programs; only the third one works.
 
TextBox/ListBox idea sounds good.

If a text box is unbound does txtName_AfterUpdate fire after each character you key in? If you put the same code in the txtName_Change event it will narrow down the filter with each subsequent character entered and I don't think there will be any great performance hit. PeteJ
(Contract Code-monkey)

It's amazing how many ways there are to skin a cat
(apologies to the veggies)
 
Is there not a possibility to write a not_in_list event?

for the query behind the combobox i used columwide 0(=keyID),5cm(=the name) so that i see the name but not the keyID. What will be stored in the reference table is the keyID.

thanks already for your quick response
 
Pete

re: If a text box is unbound does txtName_AfterUpdate fire after each character you key in?

No

Doesn't seem to work in the change event (well not after a quick play anyway).

vdzr

Not really sure I understand what you're asking. The above code will still work with you column widths set to whatever, just as if it was loaded from a table.

There are two ways to write error-free programs; only the third one works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top