I'm trying to build a query string, and the where clause will pull data corresponding to the five check boxes checked. The values for these five are either 0 or 1, 1 for yes and 0 for no.
For instance, let's say I have a user form, and the user clicks which ice cream they like:
Chocolate
Strawberry
Vanilla
Bubble Gum
Rocky Road
Now, we have an administration page which has all five of these same check boxes, and if that person from the admin group wants to see all the users that checked Chocolate and Vanilla, they'd click the first and third check box and hit "Go" to pull back the records for that query.
I know this is simple, and I could use something like a "If chbox1 ischecked then varSQL = " where chkbox1 = 1"
...etc. But I'm not sure how to search through all checkboxes and make sure if anything has been checked or not. I'm guessing I need to count up the values in a summation or loop through each of the check boxes and see if the admin user has at least checked something...or maybe they check nothing and want to see that data. That's a possibility.
I know there's a lot of knowledge out there in this forum, so I was just looking for some feedback by those who've done these scenarios.
Any suggestions are welcome!
Thanks!
For instance, let's say I have a user form, and the user clicks which ice cream they like:
Chocolate
Strawberry
Vanilla
Bubble Gum
Rocky Road
Now, we have an administration page which has all five of these same check boxes, and if that person from the admin group wants to see all the users that checked Chocolate and Vanilla, they'd click the first and third check box and hit "Go" to pull back the records for that query.
I know this is simple, and I could use something like a "If chbox1 ischecked then varSQL = " where chkbox1 = 1"
...etc. But I'm not sure how to search through all checkboxes and make sure if anything has been checked or not. I'm guessing I need to count up the values in a summation or loop through each of the check boxes and see if the admin user has at least checked something...or maybe they check nothing and want to see that data. That's a possibility.
I know there's a lot of knowledge out there in this forum, so I was just looking for some feedback by those who've done these scenarios.
Any suggestions are welcome!
Thanks!