Key word search

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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]
 
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
 
Back
Top