Below is a query i am trying to use as the row source for a list box on my form. In the criteria there is an iif statement. The false part of the iif statement works. But the true part does not.
what i have on my form is an option group which contains three radio buttons.
The choices to the user are:
0 = All
1 = Printer Type 1
2 = Printer Type 2
if the user selects the first option button, i want the query to return the records for both printer type 1 and printer type 2.
Please help me with this so that it can work the way i need to to.
SELECT Printers.ID, Printers.PartNumber, Printers.Description, Printers.ListPrice, Printers.IDTCost, Printers.LastUpdate
WHERE (((Printers.Type)=IIf([Forms]![Printers].[printerType].[value]=0,([Printers].[Type])=1 AND ([Printers].[Type])=2,[Forms]![printers].[printerType].[value])));