Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Cascading dropdown

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hermithead - 04 Mar 2008 00:19 GMT
The user selects a name from a Drop down field and then an
address automatically appears in a Text form field without the user
having to click in the Text form to trigger the change. In html
its called a cascading dropdown. This html site explains it
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/CascadingDropDown/...
Is this possible using vba?
Doug Robbins - Word MVP - 04 Mar 2008 02:23 GMT
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.

Signature

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

> The user selects a name from a Drop down field and then an
> address automatically appears in a Text form field without the user
> having to click in the Text form to trigger the change. In html
> its called a cascading dropdown. This html site explains it
> http://www.asp.net/AJAX/AjaxControlToolkit/Samples/CascadingDropDown/...
> Is this possible using vba?

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.