check box and new record buttonn

F

fossy

hello all,
On my form I have 2 check boxes and a new record button. I need the
user to check one of the boxes for sure (but only one), and if it doesn't the
button will not work...
Can anyone help me with this code

Thanks. Saul.
 
J

Jerry Whittle

First I'd use an option group instead of two check boxes. That would ensure
that only one box was checked.

Secondly I'd put some code on the On Click event of the button that would
check for a value in the option group. If there isn't one, it would raise an
error in a Message Box telling the user what they need to do then setting the
focus back to the option group. If there is a value, it would allow the new
record to proceed.
 
K

KARL DEWEY

Instead of two check boxes use an Option Group with two choices. You can set
the display to appear as check boxes and only one can be selected.
 
D

Dale Fye

Answered in the programming newsgroup.

Please don't multi-post (post the same message to multiple groups as
individual messages).

If you feel that a question NEEDS to be addressed to more than one group
(very rare with Access groups as all are monitored very closely and get
timely responses), then post it to all of the groups at the same time
(multiple addresses in the address box); this is called cross posting.

Although rarely necessary, the advantage of cross posting is that more
people will see your post, and when someone responds in either of the groups,
the response will be visible in all of the groups. This prevents wasting the
time of the volunteers that monitor these groups.
 

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