I don't know if this is possible, but I am trying to code an Access textbox that will act as a search engine entry control for a database. Specifically, I wanted to add mulitple, non-visible, listboxes to a form, and have them filled with table or query data. When ever an end-user enters a search word in the textbox and presses search, I wanted to write a series of "if" statements that would specify if the entry in the textbox matched a value in one of the listboxes, to execute a custom query. For example:
if (Me.textbox.text = a value in the listbox) then etc ...
The problem is that every example I have seen so far only searches listbox values via numerically or by index, such as listbox.selected(0). Since the textbox takes string values, as opposed to numeric values, the code must equate the textbox entry with an item in the listbox. I have been able to add a number in the search textbox and find the listbox item that way, but this is impractical since my end users will only know values. In all, I was wondering if anyone knew how to programmatically search a listbox for a specific value that equals the value entered in a textbox.
Thank you,
DFM