Key word search

G

Guest

Need help with a function to open a form and display records in which a field
contains a key word.

Eg. "Power" should return all records which contain this word in a Field1 -
PowerPoint, PowerUser etc.

I have searched help for LIKE but cannot get this to work without the user
entering * before and after the key word. I would like to search from a form
or input box.

Thanks
 
G

Guest

In the query under the field you want to filter by write the criteria, where
the user will be prompt with the message "Please enter name", and it will
search by that string as follow

Like [Please enter name] & "*"
will return all the records that start with the string entered

Like "*" & [Please enter name]
will return all the records that end with the string entered (any where)

Like "*" & [Please enter name] & "*"
will return all the records that contain the string entered

If you want to search by a text box in the form, replace [Please enter name]
with

Forms![FormName]![TextBoxName]
 
G

Guest

Thnak you for your help again.

Ofer Cohen said:
In the query under the field you want to filter by write the criteria, where
the user will be prompt with the message "Please enter name", and it will
search by that string as follow

Like [Please enter name] & "*"
will return all the records that start with the string entered

Like "*" & [Please enter name]
will return all the records that end with the string entered (any where)

Like "*" & [Please enter name] & "*"
will return all the records that contain the string entered

If you want to search by a text box in the form, replace [Please enter name]
with

Forms![FormName]![TextBoxName]


--
Good Luck
BS"D


Tom Ventouris said:
Need help with a function to open a form and display records in which a field
contains a key word.

Eg. "Power" should return all records which contain this word in a Field1 -
PowerPoint, PowerUser etc.

I have searched help for LIKE but cannot get this to work without the user
entering * before and after the key word. I would like to search from a form
or input box.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top