469,311 Members | 2,469 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Disabling selected checkboxes when one other checkbox is selected

2
Please help. I have, say, 10 checkboxes on a form. I would like the form to disable, say checkbox 7 and 8 if I select checkbox 1. How do I achieve this.
Jan 17 '07 #1
6 15866
MMcCarthy
14,534 Expert Mod 8TB
Please help. I have, say, 10 checkboxes on a form. I would like the form to disable, say checkbox 7 and 8 if I select checkbox 1. How do I achieve this.
In the After Update event of checkbox 1 you can put the following code. I am using 'check1' as the checkbox name you will need to change it.

Expand|Select|Wrap|Line Numbers
  1. Private Sub check1_AfterUpdate()
  2.  
  3.    If check1 Then ' if checkbox 1 is ticked
  4.       Me.check7.Enabled = False
  5.       Me.check8.Enabled = False
  6.    Else
  7.       Me.check7.Enabled = True
  8.       Me.check8.Enabled = True
  9.    End If
  10.  
  11. End Sub
  12.  
Mary
Jan 17 '07 #2
Tafi
2
Thanks lots Mary. It works great.
Jan 17 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
Thanks lots Mary. It works great.
That's good Tafi

I'm glad to hear it.

Mary
Jan 17 '07 #4
NeoPa
32,173 Expert Mod 16PB
Another way of doing it :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Check1_AfterUpdate()
  2.     Me!Check7.Enabled = Not Me!Check1
  3.     Me!Check8.Enabled = Not Me!Check1
  4. End Sub
Jan 18 '07 #5
MMcCarthy
14,534 Expert Mod 8TB
Another way of doing it :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Check1_AfterUpdate()
  2.     Me!Check7.Enabled = Not Me!Check1
  3.     Me!Check8.Enabled = Not Me!Check1
  4. End Sub
Did you do this while you were talking to me Ade or since.

Anyway, I remembered this after I posted but am so used to doing it the other way I didn't think of this at the time.

Mary
Jan 19 '07 #6
NeoPa
32,173 Expert Mod 16PB
I think this was before in fact.
Jan 19 '07 #7

Post your reply

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

Similar topics

2 posts views Thread by Maggie Eusebio Schock | last post: by
1 post views Thread by zoneal | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.