SSV
SSV

Reputation: 105

How to implement if one checkbox is selected then second checkbox will be auto selected?

I have two checkboxes, chkbox1 and chkbox2. I want if chbox1 is selected then,chkbox2 will be auto selected and it's value should be 1. How can i achieve this in visual basic code.Please help

Upvotes: 0

Views: 68

Answers (2)

Nathan_Sav
Nathan_Sav

Reputation: 8531

Or, checkbox2.value=checkbox1.value.

Upvotes: 1

Amandine FAURILLOU
Amandine FAURILLOU

Reputation: 612

The following code should check the checkbox2 when you check checkbox1

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

Upvotes: 0

Related Questions