I am passing several (2 to start) values from a form combo boxes.
I want to select where company name = Amazon, "and/or" where the value is $100 dollars. If one of the two fields is null for some reason the querty is not quite working. Can someone PLEASE help me re-write this query so if functions in all cases with multiple combo boxes I am a bit off.
I don't want to to be always an "AND" or always a "OR" just want the query to return the values in the populated combo boxes and if null skip the combo box.
SELECT MasterImport.Cost, MasterImport.Company_Name, *
FROM MasterImport
WHERE (((MasterImport.Cost)=IIf([Forms]![frmQuery]![cboCost] Is Not Null,[Forms]![frmQuery]![cboCost],Null)) AND ((MasterImport.Company_Name)=IIf([Forms]![frmQuery]![cboCompanyname] Is Not Null,[Forms]![frmQuery]![cboCompanyname],Null)));