ugross
asked on
settin up a query with an array of cases enabled by checkboxes
hi,
i want to set up a form with several possible fields to query, behind every field theres a checkbox to enable this part of the query, there r 5 fields each with a checkbox, i should be possible to anable one of the five as well as all 5 checkboxes so thre query is build with all the strings to look for in the specific dbfields, i was able to set up the plane query and to add the query code for one or two of the search fields but when it comes to the 3rd and more fields (checked) then the trouble starts, i think my code must be full of mistakes (wrong usage of if...then, begin, end...), thanks for helping
i want to set up a form with several possible fields to query, behind every field theres a checkbox to enable this part of the query, there r 5 fields each with a checkbox, i should be possible to anable one of the five as well as all 5 checkboxes so thre query is build with all the strings to look for in the specific dbfields, i was able to set up the plane query and to add the query code for one or two of the search fields but when it comes to the 3rd and more fields (checked) then the trouble starts, i think my code must be full of mistakes (wrong usage of if...then, begin, end...), thanks for helping
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You should write a base querey like this:
Select *
From xxx, yyy, qqq
and then add a line to you're query.sql per each checkbox that is checked like this:
if chb1.checked then
query1.sql.Add('aaa=fff and')