G
Guest
I am trying to add an IIF statement to my query criteria. I have a form with
an option group (optRept)with 2 choices: 1. Give me all records where total
sales > [Forms]![frmOrderRept].[txtSlsMin] (this a text box on the form to
enter sales $ criteria) or 2. Give me all records where total sales <=
[Forms]![frmOrderRept].[txtSlsMin]. When I run the query I am not getting the
row returned that I should.
The IIF state is as
follows:IIf([Forms]![frmOrderRept].[optRept]=1,([tblSalesSumm].[TotalSls])<Val([Forms]![frmOrderRept].[txtSlsMin]),([tblSalesSumm].[TotalSls])>=Val([Forms]![frmOrderRept].[txtSlsMin]))
When I have option 1 selected I get no rows returned. When I have option 2
selected I get only the records where TotalSales = 0.
To add to my confusion if I eliminate the IIF statement and just use one of
the criteria I get the results I want. Any help would be greatly appreciated.
an option group (optRept)with 2 choices: 1. Give me all records where total
sales > [Forms]![frmOrderRept].[txtSlsMin] (this a text box on the form to
enter sales $ criteria) or 2. Give me all records where total sales <=
[Forms]![frmOrderRept].[txtSlsMin]. When I run the query I am not getting the
row returned that I should.
The IIF state is as
follows:IIf([Forms]![frmOrderRept].[optRept]=1,([tblSalesSumm].[TotalSls])<Val([Forms]![frmOrderRept].[txtSlsMin]),([tblSalesSumm].[TotalSls])>=Val([Forms]![frmOrderRept].[txtSlsMin]))
When I have option 1 selected I get no rows returned. When I have option 2
selected I get only the records where TotalSales = 0.
To add to my confusion if I eliminate the IIF statement and just use one of
the criteria I get the results I want. Any help would be greatly appreciated.