Using Checkboxes to Search for records

G

Guest

Hi,

I would like to search for people on the basis of what sports they play.
For instance, lets say that I had a form with 3 checkboxes: basketball,
footbal, and baseball. I want to be able to click basketball on the form and
pull up all the records for people who play basketball. If I select
basketball and football, I want to find all records with either basketball
or football in their recdords.

How exactly should I set up the tables for this? In other words, how should
I store this information? Should the table have a field like "PersonID"
(linked to another table with info for this person) and then three separate
"Yes/No" fields for basketball, footbal, and baseball. Or, should the table
include only two fields: "PersonID" (a lookup column linked to the "persons"
table) and "SportsID" (a lookup column linked to the "sports" table,
including all three sports). If the latter is the better method, then how
would I use checkboxes with a form that enables me to search for these people
via the sports that they play?

Any assistance would be greatly appreciated!

-Jon
 
D

Doug Munich

If you do it the second way where you keep your sports and persons in
separate tables (which is the more flexible arrangement) then it might be
better to use several combo boxes for the user to choose sports to search
for rather than checkboxes for each sport. So maybe 3 combo boxes, each one
showing all the sports and have the form show records matching any of the
chosen sports.

But if you're always going to have a small, fixed number of sports it might
be easier to do that with Yes/No fields for each sport in the Person file.

Doug
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top