Choosing a special criteria

  • Thread starter Thread starter Safwany
  • Start date Start date
S

Safwany

I want to use a special criteria in some field with something like " IF THEN
" function, for example, If [form]![employees details]![country]="USA" THEN
preview all the countries list.

I think that MS ACCESS does not have the IF THEN function, what is the
alternative and how to use?
 
I'm not sure what your question is.

Access has an IIF function that can be used in queries.

So in a query you could use something like the following for a calculated
field. A trivial example of using that would be:

Field: ShowNothing: IIF([Field A] is Null,"Nothing There",[Field A])

You can also use VBA and create custom functions.

In criteria you can use something like the following. It will find exact
country matches unless USA is the value in [form]![employees
details]![country]. In that case it will find all records where country has a
value. It will not find records where country is Null

Field: Country
Criteria: Like IIF([form]![employees details]![country]="USA", "*",
[form]![employees details]![country])

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 

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