G
Guest
I have SQL that works fine, but I have a question about the WHERE conditions
SELECT ......
FROM ........
WHERE (((K.HardwareClass)=[Forms]![frmHardware].[cbxHClass])
AND ((K.HardwareType)=[Forms]![frmHardware].[cbxHType]));
If both cbxHClass and cbxHType have values, then the query works as planned.
However, I would like it to work even if one of the cbx's is empty, in which
case only one WHERE clause would apply and I have to 'lose' the AND. If both
cbxs are empty, there would be no WHERE at all. Can this be done? (For what
its worth, cbxHClass has numerical values, while cbxHType has literal values.
SELECT ......
FROM ........
WHERE (((K.HardwareClass)=[Forms]![frmHardware].[cbxHClass])
AND ((K.HardwareType)=[Forms]![frmHardware].[cbxHType]));
If both cbxHClass and cbxHType have values, then the query works as planned.
However, I would like it to work even if one of the cbx's is empty, in which
case only one WHERE clause would apply and I have to 'lose' the AND. If both
cbxs are empty, there would be no WHERE at all. Can this be done? (For what
its worth, cbxHClass has numerical values, while cbxHType has literal values.