access database form problem

D

daniel west

the form i have created has first name, last name and then 20 check
box options. Also, i want to make sure that they do not pick more than
4 checkboxes. i need the submit button to check that not more than 4
checkboxes are checked, i want to save the names and choices, then
start a new entry and exit
 
M

Marshall Barton

daniel said:
the form i have created has first name, last name and then 20 check
box options. Also, i want to make sure that they do not pick more than
4 checkboxes. i need the submit button to check that not more than 4
checkboxes are checked, i want to save the names and choices, then
start a new entry and exit


Sounds like a poor table design. A table should not have 20
fields for user selectable options. Instead, there should
be a separate table with a record the option and person ID.
This way counting is a matter of counting records, which is
something databases are good at.

To count yes/no fields in a record, you can take advantage
of the way a yes/no value is stored:
Abs(chk1 +chk2+ ... + chk20)
and see if that is <= 4
But taking the quick dirty way out of your current problem
will just delay the time when your flawed table design makes
other things too difficult to do without redesigning even
more parts of your database.
 

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