Hi. I'm creating a form with 10 toggle buttons on it forming a grid, and i'm trying to set it up so that if one is depressed, all the others are raised, and so on with each button.
Assuming there were only 2 buttons, i'd use the code below
Private Sub ToggleButton1_Click()
If ToggleButton1.Value = True Then
Togglebutton2.Value = False
End If
End Sub
Private Sub ToggleButton2_Click()
If ToggleButton2.Value = True Then
Togglebutton1.Value = False
End If
End Sub
Obviously, with 10 Toggles, i'd add ToggleButton3 etc, the code starts to get a little unwieldly!
Can anyone help with suggestions on how to shorten it down, assuming it's possible?
Many thanks
Thom
Assuming there were only 2 buttons, i'd use the code below
Private Sub ToggleButton1_Click()
If ToggleButton1.Value = True Then
Togglebutton2.Value = False
End If
End Sub
Private Sub ToggleButton2_Click()
If ToggleButton2.Value = True Then
Togglebutton1.Value = False
End If
End Sub
Obviously, with 10 Toggles, i'd add ToggleButton3 etc, the code starts to get a little unwieldly!
Can anyone help with suggestions on how to shorten it down, assuming it's possible?
Many thanks
Thom