table with a series (20 ) off yes/no fields

B

barret bonden

Have a table with a series (20 ) off yes/no fields ( likely a mistake , but
here I am). Have a form allowing user to choose one or two of these fields
with a check ; this form is read by a query and a report is generated .
trouble is instead of getting logical AND's (which the query calls for)I
get logical Or's ; that is I want only records with both "gym" and "adult"
checked, for example ....



This of course works:



SELECT *

FROM inquiry

WHERE ( (inquiry.adult)=forms!inq_query!adult)



And



( (inquiry.junior)=forms!inq_query!junior);



This does not







SELECT *

FROM inquiry

WHERE

( (inquiry.adult)=(forms!inq_query!adult =-1))

or

( (inquiry.junior)=(forms!inq_query!junior=-1))



UNION select * from inquiry

WHERE







( (inquiry.adult)=(forms!inq_query!adult =-1))



or



( (inquiry.junior)=(forms!inq_query!junior=-1));



My first attempt was similar to the first but for 20 "or's" followed by an
"
AND" and then 20 more or's ; it fails for now obvious reasons .



substituting a "AND" for the union statement fails too .



Is there no other way but to programmatically read the page, pick out which
check box's are checked and build a query string similar to the first query
above ? Again , I have 20 possible fields ..
 
Top