Microsoft Word field and Drop Down box question

A

Andrea

I would like to activate a drop down box in a field when the field prior has
a specific result. In other words

if prev field = a then use drop down box a
if prev field = b then use drop down box b

etc.

any tips how I can do this in Microsoft Word
 
G

Greg Maxey

It might be better to change the contents of the dropdown based on the
previous selection. Run a macro something like this on exit from the
first field:

Sub OnExitText1()
Dim oFF As FormFields
Set oFF = ActiveDocument.FormFields
Select Case oFF("Text1").Result
Case Is = "a"
With oFF("DropDown1").DropDown.ListEntries
.Clear
.Add "Apple"
.Add "Peach"
.Add "Pear"
End With
Case Is = "b"
With oFF("DropDown1").DropDown.ListEntries
.Clear
.Add "Corn"
.Add "Beans"
.Add "Rice"
End With
Case Else
oFF("DropDown1").DropDown.ListEntries.Clear
End Select
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top