this is NOT The answer..
query1
Code:select name from tblStudents where gender = 'Male';
query2
Code:select name from tblStudents where gender = 'Female';
query3
Code:select name from q1
union
select name from q2;
you will always get all fields from tblStudent.
my code.. see * means all fields.
strSQL = "Select * from tblData "
if you wanted male in this case your combo box for gender would have (All) , male, female
if the combo box was selected to Male then the code would generate
Select * from tblStudent where gender = 'Male'
change the recordsource and requery the sub form.
if you wanted male and female leave the combo to (All) and the code would return
Select * from tblStudent
change the record source and requery the sub from.
thats why I said you would make the fields that you wanted to filter combo boxes to have the All option and individual options.. if you wanted compound options then you use a list box and make it multiselct make them into a in() clauses.
This is not hard it is just time consuming to do.
hope this helps