Hi all,
I have a userform with three option buttons (call them optA, optB and optC) in the same group (i.e. only one of them can be selected).
I also have some checkboxes that all relate to one of the option buttons (say optC). I have written VBA so that if a user clicks any of the checkboxes, optC becomes selected.
There are a couple of problems though.
Firstly, when a checkbox is clicked and optC becomes selected, it does not unselect the other option buttons. So if optA was selected, then a checkbox was clicked, optA will stay selected but now optC is selected as well.
Secondly, when optC becomes selected, it appears as a grey dot in the actual control rather than a normally selected black dot. I'm guessing this means that when an option button is selected via VBA it is not truly selected?
Below is the VBA to select optC:
[VBA]
Private Sub chk1_Click()
If chk1.Value = -1 Then
optC.Value = -1
End If
End Sub
[/VBA]
I wouldn't have thought I need to set optA and optB.Value to 0 (unselected) as they are option buttons in the same group, but even if I do this it still doesn't register optC as selected.
Any advice appreciated, thanks.