Wilcard (aka LIKE) Query in Search Forms

oblivion86

Registered User.
Local time
Today, 06:47
Joined
Aug 8, 2012
Messages
38
Hi,

I am having some problems querying using wildcard search through a search form.

E.g. I am querying addresses containing the word "Jacksons" in the address:
Addresses are among the few fields that I have, e.g. Address, Name, Date of birth, Age etc.

So my usual query would be to *jackson* in the query row.

However, in a search form, would my query now be option (a) or (b)?

(a) Like "*" & [forms]![form1][address] & "*"
(b) Like "*" & [forms]![form1][address] & "*" OR Like "*" & [forms]![form1][address] & "*" Is Null

Thanks!
 
@oblivion86: If I'm not mistaking, I thought pbaldy had already explained this in one of your other threads? Option a is the only reasonable code between the two.
 
vba, yes i understand that he had already explained but I had trouble implementing it.

However, I have also managed to solve the problem by just rewriting all my other queries and adding this new query.

I am not sure why I could not get it to work when I add a new field and just write the query (when the other fields are already added and their respective queries are already typed in). I had to start fresh and retype all the queries.

Thank for your help.
 
So what do you wan to happen when the address textbox is not filled in? Should it return nothing?
 

Users who are viewing this thread

Back
Top Bottom