Check Box

S

Sandra

I have 2 check boxes on my form. One is "projection" and the other is
"actual". When doing data entry the user must check one or the other, but
never both. How do I accomplish that?

Thanks!
 
S

Sandra

Great...that works. So one additional question, how do I make it required
that one or the other be checked?
 
S

Sandra

I might be missing something here. I don't want to set the default of either
field to YES because I don't want the user to skim over it and not change it
to the other field if necessary. I want to start out with both fields
defaulting to NO, yet not let them proceed if they don't check one or the
other. I hope that makes sense.
 
L

Linq Adams via AccessMonster.com

Simplest way, in the Table definition, is to make the field attached to the
Option Group Required.

More complicated way would be to run some validation code, in the
Form_BeforeUpdate event, to insure that the Option Group isn't Null.
 
S

Sandra

The reason I didn't set the table definition on the field to Required is
because they must choose one box or the other, but never both. If I set them
both to required it wouldn't work. So what I need to somehow do is not let
them proceed without checking either "Projection" or "Actual".
 
R

Rick Brandt

Sandra said:
I have 2 check boxes on my form. One is "projection" and the other is
"actual". When doing data entry the user must check one or the
other, but never both. How do I accomplish that?

Thanks!

You should have ONE field in your table, an OptionGroup on your form with
teo RadioButtons, and make the one field in the table required = yes and
with no default value.

Both RadioButtons will start out "gray" and the user will have to select one
before the record will save.
 
A

Al Campagna

Sandra,
You're misunderstanding the Option Group logic. No matter how many
check boxes there are in an OptionGroup, the group itself only has one
value.
The Required property represents the one value returned by the Option
Group
And if that Option Group is bound to a table field, and that table field
is Required... a new record will not update until one checkbox in the Group
is selected.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
M

Michaelcip

Same issue.
I followed all the instructions in the previous posts here. My query IS
updateable. I cannot modify either of the 2 checkboxes. When I back up into
old records, neither of the two checkboxes show a check mark,...though in the
raw data the yes/no field is functioning properly. Thanks, Michael
 

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