Clickbox control help needed

B

BrianG

I would am attempting to create two clickboxes where when one is
turned On the other is turned Off automatically. No luck so far. Any
suggestions would be appreciated. Below are two of the codes I have
tried.

Private Sub CheckBox1_Click()
CheckBox1.Value = True
CheckBox2.Value = False
End Sub

Private Sub CheckBox2_Click()
CheckBox2.Value = True
CheckBox1.Value = False
End Sub

AND

Private Sub CheckBox1_Click()
If CheckBox2.Value = True Then
CheckBox2.Value = False
End If
End Sub

Private Sub CheckBox2_Click()
If CheckBox1.Value = True Then
CheckBox1.Value = False
End If
End Sub


TIA,

BrianG
 
J

Jim Thomlinson

Why not use radio buttons (small circles) as they are designed specifically
to be mutually exclusive (only one can be selected at a time).
 
B

BrianG

I'm trying to use clickboxes because the look of the clickbox on the
printed form is preferable to that of the radio button. Of course, if
I can't control the clickboxes I'll need to consider other options.


BrianG
 
J

Jim Thomlinson

You can try this...

Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
CheckBox2.Value = False
CheckBox3.Value = False
End If
End Sub

Private Sub CheckBox2_Click()
If CheckBox2.Value = True Then
CheckBox1.Value = False
CheckBox3.Value = False
End If
End Sub

Private Sub CheckBox3_Click()
If CheckBox3.Value = True Then
CheckBox1.Value = False
CheckBox2.Value = False
End If
End Sub
 

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