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

Create combo box to search on any part of field 2

Status
Not open for further replies.

Terpsfan

Programmer
Dec 8, 2000
954
US
The default behavior of Access is to search through a combo box based on the start of the field. Is there a way to search through a combo based on any part of the field. I've never seen this implemented but I am sure there is a way to get it done. Thanks
 
There is a way.


In the On Change event of the combo box...

Code:
Dim SQL As String

SQL = "SELECT MyField FROM Table1 WHERE MyField Like '*" & Combo1.Text & "*'"

Combo1.RowSource = SQL
SendKeys "%{DOWN}"

The code below...

Code:
SendKeys "%{DOWN}"

just opens the combobox up so u can see the effect on each keypress

 
Ormsk,

Thanks for your solution. It works very well.
 
It looks like it's working in that the combobox does search based on what's in the box, but when you try to make a selection it doesn't work. Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top