IIF Statement in a Parameter Query

Capilano

Registered User.
Local time
Today, 16:46
Joined
Feb 19, 2001
Messages
63
I am quite familiar with IIF statements and using them in as the criteria in Select Query. My problem is that I want to have all of the records returned (no criteria) if the Expression part is Null.

The following works, but it is not what I need...

IIf(IsNull(Forms![Form1]![Field1]),"Member","Non Member")

The syntax above works as designed and returns all of the records with "Member". I have tried to modify the syntax using a wildcard so as to reflect what I really want but to no avail. Instead, the following brings back no records instead of all of them.

IIf(IsNull(Forms![Form1]![Field1]),Like "*","Non Member")

or

IIf(IsNull(Forms![Form1]![Field1]),"Like "*"","Non Member")

Neither works! Any suggestions

Thanks In advance

Pat
 
not sure i'm reading your question correctly...but think you want to place the Like operator at the beginning of your criteria expression.

something like:

Like (IIf(IsNull(Forms![Form1]![Field1]),"Member","*")

that may point you in the right direction.

hth,
al
 
Thanks... That worked really well.

Pat
 

Users who are viewing this thread

Back
Top Bottom