I am working on a report filter form. It has 2 combo boxes
(cmboSelectSubject and cmboSelectCategory) to select criteria.
Selecting an entry in combo 1
restricts the options available in combo 2.
The row source for combo2 is:
SELECT DISTINCT tblComplaintCategory.fldComplaintCategory,
tblComplaintCategory.fldComplaintCategoryID,
tblComplaintSubjects.fldComplaintSubjectID
FROM (tblComplaints INNER JOIN tblComplaintCategory ON
tblComplaints.fldComplaintCategory =
tblComplaintCategory.fldComplaintCategoryID) INNER JOIN
tblComplaintSubjects ON tblComplaints.fldComplaintSubject =
tblComplaintSubjects.fldComplaintSubjectID
WHERE
(((tblComplaintSubjects.fldComplaintSubjectID)=[Forms]![frmReports]![cmboSelectSubject]))
ORDER BY tblComplaintCategory.fldComplaintCategory;
Pressing OK opens the report and the SQL for the report is constructed
on the fly. This is straightforward enough, but I want to add an
option "All" in
both combo boxes. I understand how to build the code to get the "All"
option in one combo box:-
SELECT 0 as fldComplaintsubjectID, "[All]" as fldComplaintsubject from
tblComplaintsubjects UNION select
tblComplaintsubjects.fldComplaintsubjectID,
tblComplaintsubjects.fldComplaintsubject from tblComplaintsubjects
ORDER BY fldComplaintsubject;
- but the <row sourcecode for combo 2 won't work to restrict the
options in combo 2 when using the code for the "All" option in combo1.
How do I overcome this?
Secondly, I want to add an "All" option to combo2. How do I make this
work with the restriction aspect of combo1?
Finally, once I get the 2 "All" options working, how do I test for
their presence when the user selects tham both as options and presses
OK for the report?
Thanks for any help you can give.
Gordon