Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding any part of a field using queries

Status
Not open for further replies.

zach028

Technical User
Nov 9, 2000
33
US
I have a query (linked to a command button on a form) that is supposed to search a table for a name value. Because the names are either "FirstName MI LastName" or "LastName, FirstName", I need to search for the value in any part of the field. My criteria looks like this:

Like "* Forms![Account Number Search]![Text8] *"

Text8 is the field where the user inputs the last name.

I continually get no return value, even when I input the exact field. Please help!
 
Hi there

It looks like your criteria is not set correctly. If you use: Like "* Forms![Account Number Search]![Text8] *"
I think it sees the exact sentence above. Maybe you could try: Like "*" & Forms![Account Number Search]![Text8] & "*"

Let me know if this works ! Missy Ed
Looking to exchange ideas and tips on VB and MS Access development as well as office 97 development. Drop me a line: msedbbw@hotmail.com
 
I have used this syntax to obtain receords if the search string is contained in any part of the field Mod:
Like "*" & [Mod?] & "*"
 
It worked like a charm, Missy. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top