Prev: Sorting does not distinguish bet ween Œ and OE or Æ and AE
Next: Need help with creating condition to produce follow-up list in Acc
From: Deo on 26 Feb 2010 16:55 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
From: John W. Vinson on 26 Feb 2010 19:51
On Fri, 26 Feb 2010 13:55:01 -0800, Deo <Deo(a)discussions.microsoft.com> wrote: >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')) -- John W. Vinson [MVP] |