Automatic population of text boxes from dropdown selections

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to produce a document in WORD 03 that will allow a user to select
items from dropdowns in a list of contents that will then populate text boxes
in other areas of the document with information relevant to the selection
made in the dropdown e.g. if the user selects apples from the drop down the
description will automatically be populated with, say "fresh and crunchy,
ideal for snacks' and the colour will populate with 'red'. If the user
selects pears different descriptions and colour would be used.
It would also be preferable for the dropdown and text box to be removed if
no selection is made in order that no gaps are left in the body of the
document.
Ideas for macro's gratefully recieved as programing is not a strong point.
 
Greg

Thanks for that.

I presume i'd substitute 'Dim oDD As DropDown' with 'Dim oTF As TextField'
(TF) and "SecondaryDD" with "PrimaryTF" or similar.
Since I do not want to ListEntries what would be the substitute for
'oDD.ListEntries' entry?

Thanks again.
 
Use something like this:

Sub OnExitDDListA()
Dim oFFs As FormFields
Set oFFs = ActiveDocument.FormFields
Select Case ActiveDocument.FormFields("DropDown1").Result
Case "A"
oFFs("Text1").Result = "First letter of alphabet"
Case "B"
Case "C"
End Select
End Sub
 
Can I add anything to auto update the text box as soon as the dropdown is
clicked. The text in the box is not updated for prints and saves without
clicking outside the dropdown and this could lead to errors.

Cheers
 
I am not 100% sure, but I think the short answer is no. That and other
annoyances are why I usually avoid protected forms and use a UserForm
instead.
 
Back
Top