Multiple Values in a Query Criteria

D

Deo

Hello,

I have a combo box on a form that allows a user to select a location code
that is used by a query. I want to run the query for two location - 73 and
28 - if location 73 is selected otherwise just run for the location
selected. In my query criteria under location I have the following code
In (iif([Forms]![frmFinancial].[cboLoc].[value]
='73',('73','28'),[Forms]![frmFinancial].[cboLoc].[value])).
However this does not work. How do I get this to read the two values.

Thanks

Deo
 
J

John W. Vinson

Hello,

I have a combo box on a form that allows a user to select a location code
that is used by a query. I want to run the query for two location - 73 and
28 - if location 73 is selected otherwise just run for the location
selected. In my query criteria under location I have the following code
In (iif([Forms]![frmFinancial].[cboLoc].[value]
='73',('73','28'),[Forms]![frmFinancial].[cboLoc].[value])).
However this does not work. How do I get this to read the two values.

Thanks

Deo

You can only pass actual values with an IIF - not operators such as commas or
quotemarks.

Try instead using a criterion of

=[Forms]![frmFinancial].[cboLoc] OR ([Forms]![frmFinancial].[cboLoc] = 73 AND
[Location] IN ('73', '28'))
 

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