N
nicaboyne
I have two sets of two checkboxes. The first set, checkbox1 and Checkbox2
have scripts to make them mutually exclusive.
Checkbox11 and checkbox12 are not active, but are set by how Checkbox1 and
checkbox2 are set. So when checkbox1 is true, checkbox11 is true, and when
Checkbox2 is true Checkbox12 is true.
The problem is the code to set Checkbox11 and Checkbox12 to false does not
execute. if I select checkbox1, checkbox11 does become true. But if I then
select Checkbox1 again to make it false, checkbox11 does not become false, it
remains true.
Here is the code I am using to do this:
Sub EnterCheck1()
With ActiveDocument
.FormFields("Checkbox11").CheckBox.Value = False
.FormFields("Checkbox12").CheckBox.Value = False
If .FormFields("Checkbox1").CheckBox.Value = True Then
.FormFields("Checkbox2").CheckBox.Value = False
.FormFields("Checkbox11").CheckBox.Value = True
End If
End With
End Sub
Is unselecting a checkbox a different event, or is there a problem in my
logic?
have scripts to make them mutually exclusive.
Checkbox11 and checkbox12 are not active, but are set by how Checkbox1 and
checkbox2 are set. So when checkbox1 is true, checkbox11 is true, and when
Checkbox2 is true Checkbox12 is true.
The problem is the code to set Checkbox11 and Checkbox12 to false does not
execute. if I select checkbox1, checkbox11 does become true. But if I then
select Checkbox1 again to make it false, checkbox11 does not become false, it
remains true.
Here is the code I am using to do this:
Sub EnterCheck1()
With ActiveDocument
.FormFields("Checkbox11").CheckBox.Value = False
.FormFields("Checkbox12").CheckBox.Value = False
If .FormFields("Checkbox1").CheckBox.Value = True Then
.FormFields("Checkbox2").CheckBox.Value = False
.FormFields("Checkbox11").CheckBox.Value = True
End If
End With
End Sub
Is unselecting a checkbox a different event, or is there a problem in my
logic?