IIF with option button

  • Thread starter Thread starter Liliane
  • Start date Start date
L

Liliane

Hi,

I have a criteria for a field "Date_Actioned":

IIf([Forms]![frmVerification]![optShowAll]=False,Is Null,Is Not Null)

I want a result that: when the option button "optShowAll" is false, select
records with Date_Actioned is null. But the quary didn't return any result.
What is the right expression?

Thanks a million!!!
 
Switch the query to SQL View.

Locate the WHERE clause.

Change it to something like this:
WHERE ((([Forms]![frmVerification]![optShowAll] <> False)
OR ([Date_Auctioned] Is Null))

Explanation:
Any criteria you type in the Criteria row in design view is applied against
a particular field. You actually need the WHERE clause to evaluate to True
for all records if your option button is unchecked. The expression above
returns True if the option button is true; otherwise it tests whether the
date field is null.
 
Thank you Allen.
My quarry is woking now. :)

Allen Browne said:
Switch the query to SQL View.

Locate the WHERE clause.

Change it to something like this:
WHERE ((([Forms]![frmVerification]![optShowAll] <> False)
OR ([Date_Auctioned] Is Null))

Explanation:
Any criteria you type in the Criteria row in design view is applied against
a particular field. You actually need the WHERE clause to evaluate to True
for all records if your option button is unchecked. The expression above
returns True if the option button is true; otherwise it tests whether the
date field is null.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Liliane said:
Hi,

I have a criteria for a field "Date_Actioned":

IIf([Forms]![frmVerification]![optShowAll]=False,Is Null,Is Not Null)

I want a result that: when the option button "optShowAll" is false, select
records with Date_Actioned is null. But the quary didn't return any
result.
What is the right expression?

Thanks a million!!!
 
Back
Top