True/False Parameter query

A

AlCamp

I have a parameter query with the parameter on a True/False field.
My parameter is...
[A=Active or I=InActive]
then I use that in an IIF statement to set the criteria...
IIF([A=Active or I=InActive] = "A",-1,0)

What I want to do is...
If the user leaves the parameter blank (null) by just hitting the Enter key,
I'd like to return BOTH True and False records.
(in other words, if the parameter is blank, don't apply any criteria to the
True/False field)

IIf(IsNull([A=Active or I=InActive]), ?What goes here?, IIF([A=Active
or I=InActive] = "A",-1,0)

Thanks in advance,
Al Camp
 
G

Guest

Change your: ?What goes here? for the name of your field, so it will
became [Your Field] = [Your Field] (which is always true) when the user press
enter

IIf(IsNull([A=Active or I=InActive]),[Your Field],IIf([A=Active or
I=InActive]="A",-1,0))


Mauricio Silva
 
A

AlCamp

Mauricio,
Excellent!! That's a real epiphany to me...
Works great... thanks for your help,
Al Camp

Mauricio Silva said:
Change your: ?What goes here? for the name of your field, so it will
became [Your Field] = [Your Field] (which is always true) when the user
press
enter

IIf(IsNull([A=Active or I=InActive]),[Your Field],IIf([A=Active or
I=InActive]="A",-1,0))


Mauricio Silva

AlCamp said:
I have a parameter query with the parameter on a True/False field.
My parameter is...
[A=Active or I=InActive]
then I use that in an IIF statement to set the criteria...
IIF([A=Active or I=InActive] = "A",-1,0)

What I want to do is...
If the user leaves the parameter blank (null) by just hitting the Enter
key,
I'd like to return BOTH True and False records.
(in other words, if the parameter is blank, don't apply any criteria to
the
True/False field)

IIf(IsNull([A=Active or I=InActive]), ?What goes here?,
IIF([A=Active
or I=InActive] = "A",-1,0)

Thanks in advance,
Al Camp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top