Filter Check Boxes

sandrao

Registered User.
Local time
Today, 18:02
Joined
Sep 6, 2007
Messages
34
How can I filter a simple check box.

I have several check boxs e.g. "Male", "Female", "Married" and "Single"
Depending on the information the entry could have Male check. the next field could be Single which would be checked.

What we would like to do is have a "Button" for each of the 4 fields and when one button is checked e.g. "Male" then all Male clients would be selected.

Any ideas how this can be accomplighed?
 
Like in all Access... many ways to do it! As I'm sure you will see from the answers to your post.... But first you need to make clear a sentence.... "What we would like to do is have a "Button" for each of the 4 fields and when one button is checked" .... You "Click" a button, you "Check" a checkbox. Which one? Either way... the value of your checkbox will be either 0 or -1 ....True or False...Yes or No.... So you button or checkbox will need to insert this value into your query, and then do a requery to show filtered records.
 
The Button is to activate the filter. You would just manually check the box for each client. then to view all checked boxs you would use the button to filter the field.
 
First I would make a suggestion. Drop the checkbox and use an option group. Logically, if you have a field for "Male" Yes/No, then you will also need one for "Female" Yes/No. Same with married. single.... what about divorced, widowed....etc... Instead of this I would use one field for example "Gender" then your values for male...Female..say 1 and 2. The best reason for this is if you have a checkbox for "Male" and one for "Female"... your user could check both. So now you have to write code to prevent this from happening. With an option group you can ONLY pick one, no additional code needed.
 
You only need one field for Male/female, beause if they are not one, then they are the other. If you only want to track married/single then you only need one field (If you are not tracking widowed/divorced etc)

The queries then could easily have yes/no criteria to filter records.

Opps, just read Curtis's reply properly, and what I have suggested is the same thing!! Doh

Dave
 
Close to the same Dave........
I suggested one field with an option group instead of checkbox.... My thinking is a one checkbox for Male/Female might be very confusing to a user.... and make a lengthy label!! "Check for "Male" - uncheck for "Female".......... plus it might be left unchecked many times....And if you wanted to add additional choices to the Married/Single field with the option group you could. I think a required option group would be better.....require that user to make an entry.
 
Perhaps I sould clairfy it a little more. What we need is some way to filter many fields that will reflect an evaluation or assement of the person...the male and female was just part of a list of options that would be clicked Yes/No. It could be likened to form that you would list various skill, abilities, that would be selected. so, does anyone know a good way of filtering fields?
 

Users who are viewing this thread

Back
Top Bottom