If statements with Query Criteria

  • Thread starter Thread starter Guest
  • Start date Start date
Maybe something like;

Like Iff ([Forms]![FormName]![Control] = "AAA",
[Forms]![FormName]![Control], ???)

The ??? is where I'm a bit lost. I want it to ignore the criteria if the IF
statement fails. Because there's other criteria.

Is there some sort of a WHERE condition in Access?
Where [Forms]![FormName]![Control] = "AAA" Like
[Forms]![FormName]![Control] etc...
 
a nested iif would work if you only have a couple of
different criteria to use:

iif (([Forms]![FormName]![Control] = "AAA",
[Forms]![FormName]![Control],Iff ([Forms]![FormName]!
[Control] = "BBB", [Forms]![FormName]![Control], etc)))

You can use 'Where' in the SQL View ... start a query hit
view / SQL views and type in there using standard sql
statements.

You can also use this in VBA but I'm not so familiar with
that to be of much help.

HTH
-----Original Message-----
Maybe something like;

Like Iff ([Forms]![FormName]![Control] = "AAA",
[Forms]![FormName]![Control], ???)

The ??? is where I'm a bit lost. I want it to ignore the criteria if the IF
statement fails. Because there's other criteria.

Is there some sort of a WHERE condition in Access?
Where [Forms]![FormName]![Control] = "AAA" Like
[Forms]![FormName]![Control] etc...


Kiwi lost in Asia said:
Can I use an If condition to define when a query applies criteria to a select
in Access?
.
 
Back
Top