PARAMETERS [Forms]![Main Form]![cmbArea] Text ( 255 );
SELECT InspectionsDI.ID,InspectionsDI.Area
FROM InspectionsDI
WHERE InspectionsDI.Area=Forms![Main Form]!cmbArea;
This code works correctly for the 12 areas that are options but I also want to allow all the records to show if Forms![Main Form]!cmbArea = "ALL"
I am not sure how to do this, I tried If statement but my syntax must have been wrong, thanks for help.
I just tried
WHERE
If (Forms![Main Form]!cmbArea <> "ALL") then
((InspectionsDI.Area)=Forms![Main Form]!cmbArea)
end if
and it gave me a syntax error (missing operator)