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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prompting for Like and Not Like (or any others) 1

Status
Not open for further replies.

Bjornson15

Technical User
Jul 6, 2005
14
0
0
US
I don't know if this is possible, but this is the place to ask this.

I am trying to have a query that can be ran 3 different ways:

1. All records.
2. Records that begins with a prompted string.
3. Records that don't begin with a prompted string.

I can do all 3 seperately, but want to do them under the same query.

All records I leave the criteria blank.
Records that begin with the prompted string looks like this:
Like [WC] & "*" (WC is what is prompted)
Records that don't begin with the prompted string looks like this:
Not Like [WC] & "*" (and WC is the prompt)


I have tried to make another prompt (for "Like" or "Not Like") to string together the criteria, but that did not work.

Is there a solution to this problem, or should I just let well enough be?

Thanks for any help that you might be able to give.

Tom
 
Something like this ?
WHERE Trim([WC] & '')=''
OR (yourField Like [WC] & '*' And [Like ?]<>'No')
OR (yourField Not Like [WC] & '*' And [Like ?]='No')

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks for your help PHV.

Worked like a charm.

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top