Question : Text field search

I have a search form for users to find an item in the database if they cannot locate it in the drop down list. The list is a standard combo box based on a query. The problem is that if you do not know how it is listed in the main list, it is difficult to find. The list is populated  as you begin to type and matches what is in the list until there are no more matches. This always starts with the beginning of the word. If you enter "T" and you have nothing that starts with a "T" the list reamins at the beginning.
To get around this when we cannot find what we need, I made a search form with the standard search fields as if you hit [ctrl+F]. Then you have to select to search "anywhere" in the field.....
How can I get simplified version for searching the field. (only one field to search) OR, is there a way to make the field find the letters that match what is keyed in regardless of where it is located in the word?
Thank you,
Mike

Answer : Text field search

Hi Mike,

the attached example may help - you'll probably need to modify it for your own db, but hopefully the principle will work for you. There's a simple form with a text box in which a text string is typed. As user types, the Key Up event is fired, which requeries the list box against the entered criteria

select * from tblYour table where txtField 1 Like "*" & [forms]![frmSearch]![txtSearch].[text] & "*"

It's the .[text] bit that makes it work (nb a fields .text value can only be referenced whilst it has focus)

Have a look and drop a post if you have any questions..

Kind regards,

Mongoose

 
Text box searcher
 
Random Solutions  
 
programming4us programming4us