simple checkbox questions
I have two check boxes; If I click on the first the box is checked, if I click on the second, I want the first box to uncheck and the second to be checked. I thought this code would do the job, but it's working like I want. What do I need to do here? :)
VB Code:
'for check box's 1 or 2 only one can be checked
If Checkbox(1).Value = 1 Then
Checkbox(2).Value = 0
End If
If Checkbox(2).Value = 1 Then
Checkbox(1).Value = 0
End If
Re: simple checkbox questions
You should really use Option Buttons. They do that withouth the code, but still:
VB Code:
Private Sub Checkbox_Click(Index As Integer)
Select Case (Index)
Case 0:
If Checkbox(0).Value = vbChecked Then Checkbox(1).Value = vbUnchecked
Case 1:
If Checkbox(1).Value = vbChecked Then Checkbox(0).Value = vbUnchecked
End Select
End Sub