tommeekers
Programmer
Hi,
I'm looking for the best way to implement an advanced search function into my application.
Right now I have my main form which has one text field, a search button and a subform. The subform shows the contents of MyTable in datasheet view. When the user enters something into the textfield and then presses the search button, I just change the source of the subform to another form which is based on a query. This query shows the exact same fields in datasheet view but has some criteria added to one field Like "*" & Forms![MyForm]![MySearchField] & "*".
I would like to expand this search function so that ALL fields can be searched (or at least more than one) and also wildcards can be used. For example when I search for %hello% it would return all records with the word hello in it, but when I search for hello% I only want those records which begin with hello. Of course I will also have to specify somewhere which fields I want to search.
How would I best handle this ? Are there any examples I can use ??
I'm looking for the best way to implement an advanced search function into my application.
Right now I have my main form which has one text field, a search button and a subform. The subform shows the contents of MyTable in datasheet view. When the user enters something into the textfield and then presses the search button, I just change the source of the subform to another form which is based on a query. This query shows the exact same fields in datasheet view but has some criteria added to one field Like "*" & Forms![MyForm]![MySearchField] & "*".
I would like to expand this search function so that ALL fields can be searched (or at least more than one) and also wildcards can be used. For example when I search for %hello% it would return all records with the word hello in it, but when I search for hello% I only want those records which begin with hello. Of course I will also have to specify somewhere which fields I want to search.
How would I best handle this ? Are there any examples I can use ??