Form Fields

  • Thread starter Thread starter Dyno
  • Start date Start date
D

Dyno

Is it at all possible to create a double drop down from field ....

I am trying to create a drop down that will narrow the choices to the second
drop down....

Example : If you choose chocolat then the second drop down will not have any
pepper and salt to it


Thanks for your help
 
Yes it is possible. Run a macro similiar to the following on entry to the
subordinate formfield:

Sub SetDDValue()
Dim oFld As FormField
Set oFld = ActiveDocument.FormFields("Dropdown2")
Select Case ActiveDocument.FormFields("Dropdown1").Result
Case "Chocolate"
oFld.DropDown.ListEntries.Add ("Sugar")
oFld.DropDown.ListEntries.Add ("Milk")
oFld.DropDown.ListEntries.Add ("Cocoa")
Case "Beans"
oFld.DropDown.ListEntries.Add ("Salt pork")
oFld.DropDown.ListEntries.Add ("Onions")
Case Else
'Do Nothing'
End Select
End Sub
 
Thanks for your help .....Much appreciated
Greg Maxey said:
Yes it is possible. Run a macro similiar to the following on entry to the
subordinate formfield:

Sub SetDDValue()
Dim oFld As FormField
Set oFld = ActiveDocument.FormFields("Dropdown2")
Select Case ActiveDocument.FormFields("Dropdown1").Result
Case "Chocolate"
oFld.DropDown.ListEntries.Add ("Sugar")
oFld.DropDown.ListEntries.Add ("Milk")
oFld.DropDown.ListEntries.Add ("Cocoa")
Case "Beans"
oFld.DropDown.ListEntries.Add ("Salt pork")
oFld.DropDown.ListEntries.Add ("Onions")
Case Else
'Do Nothing'
End Select
End Sub


--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
 
Back
Top