Searching for Keyword

P

Paul

Help

Like "*shirt*"
This expression searched the database for the word Shirt in the description.
I would like the user to be prompted for which word to use in the search.

Thanks
Paul
 
G

Gary Miller

Paul,

Not much in the way of details here on how you are doing the
search. If you would like to prompt them with an inputbox
you could do something like this for the prompting and
string building.

Dim strSearch as String

strSearch = InputBox("Enter your search word")
strSearch = "*" & strSearch & "*"

Gary Miller
Sisters, OR
 
A

Arvin Meyer

Paul said:
Like "*shirt*"
This expression searched the database for the word Shirt in the description.
I would like the user to be prompted for which word to use in the search.

In the query criteria use:

Like "*" & [Please enter your search word] & "*"

They will be prompted with:

Please enter your search word

Alternatively, you can use a search form and use this as a criteria:

Like "*" & [Forms]![TheFormName]![TextBoxName] & "*"

And the query with read from your open form.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Top