iif in the criteria

  • Thread starter Thread starter inungh
  • Start date Start date
I

inungh

I just wonder does Access query support iif in the criteria

I tried to put iif([forms]![myform]![mycheckbox], <>5, <5) in my
criteria for my field.

It seems the query does not return any records from when I ran the
query.


Are there any work around for this issue?

Your information is great appreciated,
 
Are you trying to ask the query to show values other than 5 when the box is
checked, or otherwise to show values less than 5?

If so, switch the query to SQL View.
Locate the WHERE clause.
Try something like this:

WHERE IIf(([forms]![myform]![mycheckbox], [MyField] <>5, [MyField] < 5)
 
Are you trying to ask the query to show values other than 5 when the box is
checked, or otherwise to show values less than 5?

If so, switch the query to SQL View.
Locate the WHERE clause.
Try something like this:

WHERE IIf(([forms]![myform]![mycheckbox], [MyField] <>5, [MyField] < 5)

--
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.




I just wonder does Access query support iif in the criteria
I tried to put iif([forms]![myform]![mycheckbox], <>5, <5) in my
criteria for my field.
It seems the query does not return any records from when I ran the
query.- Hide quoted text -

- Show quoted text -

Thanks millions, it works,
 
Back
Top