liseperu
asked on
Checking checkboxes to produce a SELECT statement
I have a list of checkboxes each one refering to a field in a query in an Access database,
I need to make it so that the user can build a query based on the boxes that they check. The only way I can think to do this is to write out about a million if statements to cover all possibilities. i.e.
if(chk1.value = vbchecked and chk2.value = vbunchecked and etc.. )then
do query
elseif(etc...)
there must be an easier way of doing this, I've got 9 check boxes, so doing as above would take a long time.
I would appreciate any suggestions
Thanks
I need to make it so that the user can build a query based on the boxes that they check. The only way I can think to do this is to write out about a million if statements to cover all possibilities. i.e.
if(chk1.value = vbchecked and chk2.value = vbunchecked and etc.. )then
do query
elseif(etc...)
there must be an easier way of doing this, I've got 9 check boxes, so doing as above would take a long time.
I would appreciate any suggestions
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No problem at all :)
Oh forgot to mention sorry, don't forget that last if statement, basically it closes the brackets off if you using the WHERE clause in the statement. :) Cheers
Matt
Matt
ASKER