YES/NO MSG Box

G

Guest

I have eight YES/NO boxes on one form and when the user is going down the
list only one of the boxes can be checked. Where would I place a condition
that would check to see if the other boxes have been checked and uncheck them?

Thanks in advance for the help
 
D

Douglas J. Steele

You could put logic into the AfterUpdate event of the 8 checkboxes to see
whether any of the other 7 checkboxes are checked. To minimize how much code
you need to write, you could also write a function that you could call from
the AfterUpdate event of the 8 checkboxes.
 
P

Peter R. Fletcher

Two comments:

1) If there are no circumstances under which more than one of the
boxes can ever validly be checked, I would modify your Table to use a
single Field with multiple possible (byte or integer) values to store
the data rather than multiple Yes/No Fields, since that corresponds
more closely to the reality that you are representing. In addtion, if
you come up with another possibility to record, you just need to add a
new value, with supporting code where necessary, rather than having to
change the Table structure and modify every Form that uses it.

2) I would use Radio Buttons in an Option Group on your Form. If you
use a single Field, the Field can be bound to the Group and you need
almost no code. If you stick to your Yes/No Fields, the Group will be
Unbound, and you can use code in the Form's Current Event and the
Group's AfterUpdate Event to respond to and flip the appropriate
Yes/No Fields. In either case, the "one and only one" rule is enforced
for you by the Control.

I have eight YES/NO boxes on one form and when the user is going down the
list only one of the boxes can be checked. Where would I place a condition
that would check to see if the other boxes have been checked and uncheck them?

Thanks in advance for the help

Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher
 

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