I am a novice at VBA and I was looking to do something smiliar and found this method.
I wanted a dropdown to set the relevant checkbox. Initially I read that you cannot set checkbox values, but eventually found that you can and how from
here from which I created the following code
Hope it helps.?
Code:
Function SetChkType()
Dim strType As String
Dim oFFld As FormFields
strType = ActiveDocument.FormFields("lstType").Result
Set oFFld = ActiveDocument.FormFields
' Initialise checkboxes to empty (False)
oFFld("chkAnswer").CheckBox.Value = False
oFFld("chkPhone").CheckBox.Value = False
oFFld("chkVisit").CheckBox.Value = False
oFFld("chkLetter").CheckBox.Value = False
oFFld("chkRefer").CheckBox.Value = False
oFFld("chkEmail").CheckBox.Value = False
' Now set the correct one to True
Select Case strType
Case "A"
oFFld("chkAnswer").CheckBox.Value = True
Case "T"
oFFld("chkPhone").CheckBox.Value = True
Case "P"
oFFld("chkVisit").CheckBox.Value = True
Case "L"
oFFld("chkLetter").CheckBox.Value = True
Case "R"
oFFld("chkRefer").CheckBox.Value = True
Case "E"
oFFld("chkEmail").CheckBox.Value = True
End Select
End Function