checkbox

  • Thread starter ryan.fitzpatrick3
  • Start date
R

ryan.fitzpatrick3

I have 2 checkboxes, I want it so only one can be selected not both,
so how do I do this? More or less if the left one is clicked I'd like
the right one to be disabled and vise versa. Would this be if
statement?
 
B

Beetle

In the after update event of the check boxes you could use code similar to
this (input your actual control names)

Private Sub MyCheck_AfterUpdate()
Me.OtherCheck = Not Me.MyCheck
End Sub

Private Sub OtherCheck_AfterUpdate()
Me.MyCheck = Not Me.OtherCheck
End Sub

Another "option" would be to use an option group, which would only allow
one selection at a time.
 
R

ryan.fitzpatrick3

Awesome that worked! Thanks

In the after update event of the check boxes you could use code similar to
this (input your actual control names)

Private Sub MyCheck_AfterUpdate()
Me.OtherCheck = Not Me.MyCheck
End Sub

Private Sub OtherCheck_AfterUpdate()
Me.MyCheck = Not Me.OtherCheck
End Sub

Another "option" would be to use an option group, which would only allow
one selection at a time.
 

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