Thread: drop down lists
View Single Post
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default drop down lists

No. 25 is a maximum.
You can populate a dropdown list with vba based on the content of another
field as demonstrated in Greg Maxey's macro below

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 "A"
With oDD.ListEntries
.Add "Apples"
.Add "Apricots"
.Add "Artichokes"
End With
Case "B"
With oDD.ListEntries
.Add "Blueberries"
.Add "Beets"
.Add "Brocolli"
End With
Case "C"
With oDD.ListEntries
.Add "Cherries"
.Add "Celery"
.Add "Cilantro"
End With
End Select
End Sub

or you can do the lot with a userform with a time control - which would be
rather more elegant.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


LXDZINE wrote:
Can i get more than 25 options for drop down lists? I want to do a
time sheet where people can choose a time closest to a half hour
based on a 24 hr clock.

Any ideas?
Thanks,jjc