Cascading dropdown

D

Doug Robbins - Word MVP

If the address associated with each entry in the Drop Down Form Field is
stored as an autotext entry, the name of which corresponds to the name in
the Drop Down Form Field, the following code run exit from the Drop Down
Form Field will cause the address that is associated with the selected name
to appear in a Text FormField.

' Macro created 15-11-97 by Doug Robbins to add the address corresponding to
a drop down name
'
Set myDrop = ActiveDocument.FormFields("Dropdown1").DropDown
Company = myDrop.ListEntries(myDrop.Value).Name
Address = ActiveDocument.AttachedTemplate.AutoTextEntries(Company).Value
ActiveDocument.FormFields("Text1").Result = Address

Something has to trigger the macro, and in the case of Form Fields, it is
either On-Exit or On Entry to a Form Field. With the above code, it is not
necessary to click into the Text Form Field in which the address is to be
displayed, but there must be somewhere else for the selection to go on Exit
from the Drop Down Form Field.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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