Sort Field or Not Sort Field

P

protean_being

I have a form that contains a check box called chkPrimaryLocation and a combo
box called cboPrimaryLocation. This form is an entry page that runs a query
to generate a report. What I want to do is to uncheck the box if I want to
see all non null fields and check the box if I want to see only the selected
location in the combo box.
How do I define the criteria for PrimaryLocation in the query to make this
work?
 
K

KARL DEWEY

Criteria for PrimaryLocation --
Like IFF([Forms]![YourFormName]![chkPrimaryLocation] = 0, "*",
[Forms]![YourFormName]![cboPrimaryLocation])

In neither case will you records that location is null.
 
J

John W. Vinson

Criteria for PrimaryLocation --
Like IFF([Forms]![YourFormName]![chkPrimaryLocation] = 0, "*",
[Forms]![YourFormName]![cboPrimaryLocation])

In neither case will you records that location is null.

minor typo, Karl - I'm sure you meant IIf (not IFF).
 

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