Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check one or the other, how do I set this up?

Status
Not open for further replies.

Wease

Technical User
Jul 8, 2001
19
US
I'm an Access newbie, so please bear with me. I have two check boxes (Single Membership & Family Membership). I only want one to be checked for a given individual. If one is checked the other must remain unchechecked. Can someone tell me how to do this?

Also, upon checking one of these fields I want an amount to be posted to a a row in my database. For instance, if single membership is checked and the record is saved; place a value of $200 in the appropriate field in my database.
 
The simplest solution is to eliminate one of the check boxes. If it's checked then it's a family membership (for example) ... if not checked, it's single.

If you want to have both then use radio buttons rather than check boxes. The behavior that you want is automatic with radio buttons. Put them in a frame if you need several groups of radio buttons.

If you really want two check boxes then
Code:
Private Sub Check0_Click()
    Check1.Value = Not Check0.Value
End Sub

Private Sub Check1_Click()
    Check0.Value = Not Check1.Value
End Sub
 
Thanks Golum !!! I used the VB code you gave me and changed the check boxes to option boxes inside a frame. The combination therein, is exactly what I was looking for !!!
 
Wease
I'm sure what Golom give you is great but I think the best way to do what you want is an option group. I think that is what Golom was trying to say. With a option group you can have radio buttons or check boxes and only one can be checked at any one time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top