469,077 Members | 1,380 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,077 developers. It's quick & easy.

Yes /No Option Buttons

I have two columns in table, both format as number for Yes/no purposes. I also create two Yes/No fields in form. One is option button (yes/no) group1 and other is option button (yes/no) group2. I would like to design so that when I click yes in the group1, it will allow me to select either Yes or no in group2. If I click No in group1, it will NOT allow me to select Yes/no in group2. Also keep in mind that peeple might mistakenly click yes in group1 and then change their mind to unselect. That mean the user has to able to uncheck the buttons.
Is it possible to make it happen? Please help. Thanks.
Oct 6 '10 #1
1 3685
gnawoncents
214 100+
Assuming your yes value is 1 and no is 2, add the following code to the after update event of group1

Expand|Select|Wrap|Line Numbers
  1. Private Sub group1_AfterUpdate()
  2. Me.group2 = 0
  3. If Me.group1 = 1 Then
  4.   Me.group2.Locked = False
  5. Else
  6.   Me.group2.Locked = True
  7. End If
  8. End Sub 
You would also want to set group2.Locked = false in the on open event of the form to make sure it is disabled to begin.
Oct 6 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Saxman | last post: by
2 posts views Thread by PM | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.