select only one checkbox

Z

zufie

Hi,
I have a form which has multiple checkboxes as many as two or three
checkboxes (choices) per question.

I want to ensure the user can only select one and only one checkbox
per question.

Each checkbox represents an individual field.

For example, for the question: Did an agency contact you? The choices
are: YES or No (Two separate checkboxes)

Or another example is the question: How long before you hear from the
agency: 1 Week or 2 Weeks or 3 Weeks (Three separate checkboxes)

I know I cannot use an option group as each checkbox represents an
individual field.

Any ideas?

Thanks!

John
 
K

KARL DEWEY

I know I cannot use an option group as each checkbox represents an
individual field.
Based on your examples I see no reason why you can not use an option group.
You do not need two fields to record a Yes or No response.
The number of weeks can be recorded in a single field.

Explain a little more why you can not use the option group.
 
J

John W. Vinson

I know I cannot use an option group as each checkbox represents an
individual field.

In that case your table design *is wrong*. Fields should be dependent only on
the primary key, not upon each other. If a field has five choices, only one of
which can be selected for a given question, you should have *one* field with
an integer value encoding the desired choice.

With your current "one field per choice" design you'll have no builtin way to
constrain this. instead you'll need some rather snarky VBA code, probably
different for each question, to check what values have been selected in the
form's BeforeUpdate event and disallow multiple replies.

For a good, normalized questionnaire database design, see Duane Hookum's "At
Your Survey":
http://www.rogersaccesslibrary.com/Otherdownload.asp?SampleName='At Your Survey 2000'
 

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