need help with LIKE Operator!

Essendon

Registered User.
Local time
Today, 23:39
Joined
Oct 25, 2001
Messages
65
Hi all,

Could anyone explain why the following LIKE statement:

Like "*adam*"

works well, on a single name field that includes first name and last name, returning results such as:
Adams Dane
Wright Adam
Thornber Adam
Adamson Geoff

But when I try to get user input (instead of using adam) from a form:

Like "*[Forms]![Query Dialog]![Name]*"

(name is a text field on the Query Dialog Form)

It wont work at all!

What changes to the above code need to be made to make it work like the first example?

I would appreciate any help...Thanks in advance,

Peter
 
By putting the control name inside double quotes, you're telling access to look for that STRING, rather than the value in the contorl. Try this:

Like ("*" & [Forms]![Criteria]![String] & "*")
 
Like "*" & [Forms]![Query Dialog]![Name] & "*"
 
Thankyou very much for your help. It is greatly appretiated.
 
You can tell it's late in the day here--my typing is shot and I'm no long switching my "test" field names back to the ones the other person used :O

Many thanks and great respect to Jack & Pat

--Sheepish Mac
 

Users who are viewing this thread

Back
Top Bottom