ALL criteria in a query

  • Thread starter Thread starter Jade
  • Start date Start date
J

Jade

In my query, one of the field's has criteria that points
to a check box on a form. It says that if it's checked,
make the criteria equal to "A" else make it pull all from
the query as if there were no criteria. I don't know how
to get it to pull all if the check box isn't checked. If
I say:
IIf ([CheckBox]=True,"A","")
then if the check box isn't checked, the query is looking
for a null value but I want it to pull everything. I
also tryed:
IIf ([CheckBox]=True,"A","*")
But that doesn't work. Is there a symbol that's used to
pull everything? Thanks for the help in advance.

Jade
 
In my query, one of the field's has criteria that points
to a check box on a form. It says that if it's checked,
make the criteria equal to "A" else make it pull all from
the query as if there were no criteria. I don't know how
to get it to pull all if the check box isn't checked. If
I say:
IIf ([CheckBox]=True,"A","")
then if the check box isn't checked, the query is looking
for a null value but I want it to pull everything. I
also tryed:
IIf ([CheckBox]=True,"A","*")
But that doesn't work. Is there a symbol that's used to
pull everything? Thanks for the help in advance.

You are referring to a form, so I believe the condition is built in the
check boxes AfterUpdate procedure, not in the query itself, correct?

Then I would include the condition within the iif statement:

.... & IIF(Me!CheckBox=True," WHERE [MyField]='A'","") & "...

HTH - Peter
 
Back
Top