IIF with option button

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!!!
 
A

Allen Browne

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.
 
L

Liliane

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!!!
 

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