If statements with Query Criteria

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can I use an If condition to define when a query applies criteria to a select
in Access?
 
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?
.
 

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

Back
Top