how to reset dependent drop boxes in MS Word?
Hi all,
I have 4 dependent drop down boxes in MS Word, once I've made my selections and got the result in drop down box# 4, I want to reset all the boxes (by selecting "New Clauses" in the first box). Question is how do I do this?
Below are the 4 modules.
Thank you
Module 1
Sub Populatedd6ABC()
Select Case ActiveDocument.FormFields("dd12AB").Result
Case "New Clauses"
With ActiveDocument.FormFields("dd6ABC").DropDown.ListEntries
.Clear
.Add "New Clauses "
End With
Case "A=No, B=No"
With ActiveDocument.FormFields("dd6ABC").DropDown.ListEntries
.Clear
.Add "A=Yes, B=No, C=No"
End With
End Select
End Sub
Module 2:
Sub Populatedd11ADEB()
Select Case ActiveDocument.FormFields("dd6ABC").Result
Case "A=Yes, B=No, C=No"
With ActiveDocument.FormFields("dd11ADEB").DropDown.ListEntries
.Clear
.Add "A=YES, D=YES, E=YES, B=YES"
.Add "A=YES, D=YES, E=YES, B=NO"
.Add "A=YES, D=NO, E=YES"
.Add "A=YES, D=NO, E=NO"
End With
End Select
End Sub
Module 3:
Sub PopulateddSummaryChart()
Select Case ActiveDocument.FormFields("dd11ADEB").Result
Case "A=YES, D=YES, E=YES, B=YES"
With ActiveDocument.FormFields("ddSummaryChart").DropDown.ListEntries
.Clear
.Add "(E=YES)Highest DSC level equal to or higher than COMSEC= YES"
.Add "(E=YES)Highest DSC level equal to or higher than COMSEC= No"
End With
Case "A=YES, D=YES, E=NO, B=YES"
With ActiveDocument.FormFields("ddSummaryChart").DropDown.ListEntries
.Clear
.Add "(E=NO)Highest DSC level equal to or higher than COMSEC= YES"
.Add "(E=NO)Highest DSC level equal to or higher than COMSEC= No"
End With
Case "A=YES, D=YES, E=NO, B=NO"
With ActiveDocument.FormFields("ddSummaryChart").DropDown.ListEntries
.Clear
.Add "(E=NO, B=NO)Highest DSC Level= Protected"
.Add "(E=NO, B=NO)Highest DSC Level= Classified"
End With
Case "A=YES, D=YES, E=YES, B=NO"
With ActiveDocument.FormFields("ddSummaryChart").DropDown.ListEntries
.Clear
.Add "(E=YES, B=NO)Highest DSC Level= Protected"
.Add "(E=YES, B=NO)Highest DSC Level= Classified"
End With
Case "A=YES, D=NO, E=YES"
With ActiveDocument.FormFields("ddSummaryChart").DropDown.ListEntries
.Clear
.Add "(E=YES)Highest DSC Level= Protected"
.Add "(E=YES)Highest DSC Level= Classified"
End With
Case "A=YES, D=NO, E=NO"
With ActiveDocument.FormFields("ddSummaryChart").DropDown.ListEntries
.Clear
.Add "(E=NO)Highest DSC Level= Protected"
.Add "(E=NO)Highest DSC Level= Classified"
End With
End Select
End Sub
Module 4:
Sub PopulateddSeeNote()
Select Case ActiveDocument.FormFields("ddSummaryChart").Result
Case "(E=YES)Highest DSC level equal to or higher than COMSEC= YES"
With ActiveDocument.FormFields("ddSeeNote").DropDown.ListEntries
.Clear
.Add "11B=YES & 11C=Yes - see note: 1"
.Add "11B=YES & 11C=NO - see note: 3"
End With
Case "(E=NO)Highest DSC level equal to or higher than COMSEC= YES"
With ActiveDocument.FormFields("ddSeeNote").DropDown.ListEntries
.Clear
.Add "11B=YES & 11C=Yes - see note: 8"
.Add "11B=YES & 11C=NO - see note: 9"
End With
Case "(E=YES)Highest DSC level equal to or higher than COMSEC= No"
With ActiveDocument.FormFields("ddSeeNote").DropDown.ListEntries
.Clear
.Add "11B=YES - ERROR SEE NOTE: 2"
End With
Case "(E=NO)Highest DSC level equal to or higher than COMSEC= No"
With ActiveDocument.FormFields("ddSeeNote").DropDown.ListEntries
.Clear
.Add "11E=NO & 11B=YES - ERROR SEE NOTE: 10"
End With
Case "(E=NO, B=YES)Highest DSC Level= Protected"""
With ActiveDocument.FormFields("ddSeeNote").DropDown.ListEntries
.Clear
.Add "11B=NO & 11C=Yes - see note: 4"
.Add "11B=NO & 11C=NO - see note: 5"
End With
Case "(E=NO, B=NO)Highest DSC Level= Protected"""
With ActiveDocument.FormFields("ddSeeNote").DropDown.ListEntries
.Clear
.Add "11B=NO & 11C=Yes - see note: 11"
.Add "11B=NO & 11C=NO - see note: 12"
End With
Case "(E=YES, B=NO)Highest DSC Level= Classified"
With ActiveDocument.FormFields("ddSeeNote").DropDown.ListEntries
.Clear
.Add "11B=NO & 11C=Yes - see note: 6"
.Add "11B=NO & 11C=NO - see note: 7"
End With
Case "(E=NO, B=NO)Highest DSC Level= Classified"
With ActiveDocument.FormFields("ddSeeNote").DropDown.ListEntries
.Clear
.Add "11B=NO & 11C=Yes - see note: 13"
.Add "11B=NO & 11C=NO - see note: 14"
End With
End Select
End Sub
1 Attachment(s)
trying to do 5 levels of drop down
Hi Paul, I did as best I could with my limited knowledge of programing, compared the 2 level with the 3 level dropdown you made. Please take a look and let me know what's wrong. I did take courses in C++ and APL but that was "decades" ago. Anyway could you take a look, I notices "blocks" of code so I repeated them only changing the words for the dropdown menus. Thank you
(I hope the file attached correctly)
1 Attachment(s)
Tips on how to modify this amazing code for amateur programmers like me
For those that have a very limited knowledge of VBA, (like me)
I thought I would add a few "Tips" on how to modify this code for your needs, Macropod provided this amazing code.
Enjoy