Macro for fillable form

  • Thread starter Thread starter srain001
  • Start date Start date
S

srain001

Hi,

I'm looking for a macro which will enable me to have a text box appear
whenever a specific item is selected from a drop down menu in another box.

For example,

If PRESENTATION is selected from the dropdown menu in box 1, then I'd like
box 2 to appear with its own list. On the other hand, if ASSISTANCE is
selected, I'd like Box 3 to appear, and so on.

I hope you can help!

Thanx!
SRain
 
Courtesy of my old pal Greg Maxey http://gregmaxey.mvps.org/word_tips.htm
you can populate a second dropdown field based on the content of a first eg

Sub OnExitDDListA()
'Greg Maxey
Dim oDD As DropDown
Set oDD = ActiveDocument.FormFields("SecondaryDD").DropDown
'Clear previous list
oDD.ListEntries.Clear
'Repopulate list based on user selection
Select Case ActiveDocument.FormFields("PrimaryDD").Result
Case "PRESENTATION"
With oDD.ListEntries
.Add "Apples"
.Add "Apricots"
.Add "Artichokes"
End With
Case "ASSISTANCE"
With oDD.ListEntries
.Add "Blueberries"
.Add "Beets"
.Add "Brocolli"
End With
Case Else
'Do nothing
End Select
End Sub

run on entry from the first dropdown field named PrimaryDD if the selected
content is PRESENTATION, the second dropdown field named SecondaryDD is
populated with the first list. If ASSISTANCE is selected, the second field
is populated with the second list. Each list can contain up to 25 items.

You will find more information about populating list boxes and cascading
userforms on Greg's web site.


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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

Back
Top