Advanced search box

Boo

Registered User.
Local time
Yesterday, 16:37
Joined
Aug 30, 2004
Messages
32
I want to make something similar to the Google search box, although not quite as complicated.

I would like to be able to type more than one word in a search box.
I am only searching on 1 field [Title]. The query would show all the records with the first search word in the Title, plus all the records with the second search word in the Title.

I have a query now that has the below in the Title field criteria:
Like "*" & [forms]![Searchform]![searchcontrol] & "*"

This searches for the word typed into the searchcontrol no matter where the word is in the title. It works great, but I can only type in one word at a time.
 
Hi -

You will need to break up the input line into multiple search keys.

Take a look at the InStr function, which may be helpful. You can use it to find the spaces that separate words. Then use RIGHT or LEFT to break off the words.

Store the search keys in an array or collection. Then when you have all of them from the input line, build a WHERE statement that includes all the appropriate keys.

hth,

- g
 

Users who are viewing this thread

Back
Top Bottom