On Dec 14, 9:17 am, bcap <r...@patriots.comwrote:
Hi,
I am looking to write a query with multiple factors and do not know
the best way to do it.
I want use Event Type, Status, and Region as my queries variables.
By
default I want show "all", but then be able to use drop downs to
filter with.
Can anyone please give me an idea on the best way to do this? If
this
does not seem to make sense, please let me know.
Kind Regards,
Ray
In the combo box, use a union query to add '<All>' to your result set
with the ID set to 0. Eg.
SELECT idPaymentType, txtPaymentType
FROM tblPaymentTypes
UNION
SELECT 0,"<All>"
From tblPaymentTypes;
Typically, in the where clause of your SQL, then use this syntax:
WHERE (idPaymentType = <the combo valueor 0=<the combo value>)
This causes the WHERE clause to be ignored if all is selected. You can
do this with several combo boxes to have the desired effect.
Hope this helps!