Syntax

Joshann

Registered User.
Local time
Today, 05:54
Joined
Mar 22, 2002
Messages
142
I just can't seem to get my syntax right today. I'm trying to use an OR operator. Whithout the OR, this works fine:

strSearchAll = "[FIELD] LIKE '" & "*text*" & "'"
DoCmd.OpenForm "frmDebtorsSubs", , , strSearchAll

I want to add an Or that would be "[FIELD2] LIKE '" & "*text*" & "'" but I can't seem to put the whole statement together. Any help would be greatly appreciated!
 
Just an observation, but if you're having to search multiple fields for the same text, you may have a structure design problem.

If that's not the case, try something like
strSearchAll = "[SomeField] Like '*" & [SomeText] & "*' OR [OtherField] Like '*" & [OtherText] & "*'"

Or post what you're attempting to use.

Good luck,
David R
 
Actually, I'm searching fields in two different databases. That did it. Thanks!
 

Users who are viewing this thread

Back
Top Bottom