johnqtr
asked on
Uncheck checkbox when other checkbox is selected
I have three checkboxes:
prodCheck
tankCheck
dateCheck
I have been trying to write some code that will uncheck the other checkboxes that are NOT selected. I thought that I could just write something like:
If tankCheck.Checked = True Then
prodCheck.Checked = False
End If
But, that doesn't work. In other words, you can only have one checkbox selected at a time.
prodCheck
tankCheck
dateCheck
I have been trying to write some code that will uncheck the other checkboxes that are NOT selected. I thought that I could just write something like:
If tankCheck.Checked = True Then
prodCheck.Checked = False
End If
But, that doesn't work. In other words, you can only have one checkbox selected at a time.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
use RadioButton instead
ASKER
Dropdown would be better. I just didn't think about that. Thanks!
If prodCheck.Checked OrElse tankCheck.Checked then dateCheck.Checked = False
If tankCheck.Checked OrElse dateCheck.Checked then prodCheck.Checked = False
If prodCheck.Checked OrElse dateCheck.Checked then tankCheck.Checked = False