K
kalfonso82
I am having trouble having the previous checkboxes cleared and the correct
checkboxes chosen when a different dropdown option is chosen.
Please look at my code below and see where I have made my mistake.
Sub riskCodeDrop()
If ActiveDocument.FormFields("riskCodeDrop").DropDown.Value = 2 Then
ActiveDocument.FormFields("autoBox").CheckBox.Value = True
ActiveDocument.FormFields("end0735Box").CheckBox.Value = True
ActiveDocument.FormFields("end0809Box").CheckBox.Value = True
ActiveDocument.FormFields("end0811Box").CheckBox.Value = True
End If
If ActiveDocument.FormFields("riskCodeDrop").DropDown.Value = 5 Then
ActiveDocument.FormFields("motoBox").CheckBox.Value = True
ActiveDocument.FormFields("end0809Box").CheckBox.Value = True
ActiveDocument.FormFields("end0810Box").CheckBox.Value = True
ActiveDocument.FormFields("end0811Box").CheckBox.Value = True
End If
If ActiveDocument.FormFields("riskCodeDrop").DropDown.Value = 4 Then
ActiveDocument.FormFields("rvBox").CheckBox.Value = True
ActiveDocument.FormFields("end0809Box").CheckBox.Value = True
ActiveDocument.FormFields("end0811Box").CheckBox.Value = True
ActiveDocument.FormFields("end0812Box").CheckBox.Value = True
End If
If ActiveDocument.FormFields("riskCodeDrop").DropDown.Value = 3 Then
ActiveDocument.FormFields("truckBox").CheckBox.Value = True
ActiveDocument.FormFields("end0809Box").CheckBox.Value = True
ActiveDocument.FormFields("end0811Box").CheckBox.Value = True
End If
If ActiveDocument.FormFields("riskCodeDrop").DropDown.Value = 1 Then
ActiveDocument.FormFields("autoBox").CheckBox.Value = False
ActiveDocument.FormFields("motoBox").CheckBox.Value = False
ActiveDocument.FormFields("rvBox").CheckBox.Value = False
ActiveDocument.FormFields("truckBox").CheckBox.Value = False
ActiveDocument.FormFields("end0735Box").CheckBox.Value = False
ActiveDocument.FormFields("end0809Box").CheckBox.Value = False
ActiveDocument.FormFields("end0809Box").CheckBox.Value = False
ActiveDocument.FormFields("end0810Box").CheckBox.Value = False
ActiveDocument.FormFields("end0811Box").CheckBox.Value = False
ActiveDocument.FormFields("end0812Box").CheckBox.Value = False
End If
If ActiveDocument.FormFields("riskCodeDrop").DropDown.Value = 6 - 21 Then
ActiveDocument.FormFields("autoBox").CheckBox.Value = False
ActiveDocument.FormFields("motoBox").CheckBox.Value = False
ActiveDocument.FormFields("rvBox").CheckBox.Value = False
ActiveDocument.FormFields("truckBox").CheckBox.Value = False
ActiveDocument.FormFields("end0735Box").CheckBox.Value = False
ActiveDocument.FormFields("end0809Box").CheckBox.Value = False
ActiveDocument.FormFields("end0809Box").CheckBox.Value = False
ActiveDocument.FormFields("end0810Box").CheckBox.Value = False
ActiveDocument.FormFields("end0811Box").CheckBox.Value = False
ActiveDocument.FormFields("end0812Box").CheckBox.Value = False
End If
End Sub
checkboxes chosen when a different dropdown option is chosen.
Please look at my code below and see where I have made my mistake.
Sub riskCodeDrop()
If ActiveDocument.FormFields("riskCodeDrop").DropDown.Value = 2 Then
ActiveDocument.FormFields("autoBox").CheckBox.Value = True
ActiveDocument.FormFields("end0735Box").CheckBox.Value = True
ActiveDocument.FormFields("end0809Box").CheckBox.Value = True
ActiveDocument.FormFields("end0811Box").CheckBox.Value = True
End If
If ActiveDocument.FormFields("riskCodeDrop").DropDown.Value = 5 Then
ActiveDocument.FormFields("motoBox").CheckBox.Value = True
ActiveDocument.FormFields("end0809Box").CheckBox.Value = True
ActiveDocument.FormFields("end0810Box").CheckBox.Value = True
ActiveDocument.FormFields("end0811Box").CheckBox.Value = True
End If
If ActiveDocument.FormFields("riskCodeDrop").DropDown.Value = 4 Then
ActiveDocument.FormFields("rvBox").CheckBox.Value = True
ActiveDocument.FormFields("end0809Box").CheckBox.Value = True
ActiveDocument.FormFields("end0811Box").CheckBox.Value = True
ActiveDocument.FormFields("end0812Box").CheckBox.Value = True
End If
If ActiveDocument.FormFields("riskCodeDrop").DropDown.Value = 3 Then
ActiveDocument.FormFields("truckBox").CheckBox.Value = True
ActiveDocument.FormFields("end0809Box").CheckBox.Value = True
ActiveDocument.FormFields("end0811Box").CheckBox.Value = True
End If
If ActiveDocument.FormFields("riskCodeDrop").DropDown.Value = 1 Then
ActiveDocument.FormFields("autoBox").CheckBox.Value = False
ActiveDocument.FormFields("motoBox").CheckBox.Value = False
ActiveDocument.FormFields("rvBox").CheckBox.Value = False
ActiveDocument.FormFields("truckBox").CheckBox.Value = False
ActiveDocument.FormFields("end0735Box").CheckBox.Value = False
ActiveDocument.FormFields("end0809Box").CheckBox.Value = False
ActiveDocument.FormFields("end0809Box").CheckBox.Value = False
ActiveDocument.FormFields("end0810Box").CheckBox.Value = False
ActiveDocument.FormFields("end0811Box").CheckBox.Value = False
ActiveDocument.FormFields("end0812Box").CheckBox.Value = False
End If
If ActiveDocument.FormFields("riskCodeDrop").DropDown.Value = 6 - 21 Then
ActiveDocument.FormFields("autoBox").CheckBox.Value = False
ActiveDocument.FormFields("motoBox").CheckBox.Value = False
ActiveDocument.FormFields("rvBox").CheckBox.Value = False
ActiveDocument.FormFields("truckBox").CheckBox.Value = False
ActiveDocument.FormFields("end0735Box").CheckBox.Value = False
ActiveDocument.FormFields("end0809Box").CheckBox.Value = False
ActiveDocument.FormFields("end0809Box").CheckBox.Value = False
ActiveDocument.FormFields("end0810Box").CheckBox.Value = False
ActiveDocument.FormFields("end0811Box").CheckBox.Value = False
ActiveDocument.FormFields("end0812Box").CheckBox.Value = False
End If
End Sub