Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking Dropdowns in Word XP

Status
Not open for further replies.

hofburg

MIS
Feb 15, 2002
27
AT
Hello,

we have a number of historical Word Documents which feature dropdown boxes related to each other (Like name & position). E.g. if in DD1 I choose "Mike" then DD2 should be "Engineer", if DD1 is "Peter" than DD2 should be "Salesman". Ideally DD2 should change automatically as DD1 is changed. I managed to change both DDs simultaneously by a pushbutton, but unfortunately a pushbutton gets printed. Seems I'd need an element that is visible, can take VB code and be clicked on, but doesnt get printed.
Any help is appreciated.
Many thanks
 
Right click the PushButton, choose property and untick the Print checkbox.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks PHV,

what I have is a CommandButton. In Excel, which is what I play more with, nothing easier than to untick the "print" box. In Word VBA, I my commandbutton shows 17 properties, but none says anything about (not) printing, or am I overseeing the obvious? Or is there another kind of button I can create?
Thanks anyway.

ZH
 
Sorry, I was talking for Excel[blush]

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I am confused. You refer to a commandbutton - that to me means a UserForm. Yet reading the post it sounds like these are dropdowns in the document itself, not a UserForm. Could you please clarify? Are you saying you have put a macro button in the document that resets DD2?

If they are dropdowns (that is, formfield dropdowns, NOT Userform controls), then write exit macros for DD1 that conditionally sets DD2. That being said, if there is conditional logic to the result of DD1, then DD2 need not be a dropdown at all, just a text formfield with the logic result of DD1. In any case, if DD2 is logically derived, then there is no printing problem.

Further point, as these are "historical" documents, does that mean the results are already selected?

Depending on the number of dropdowns (and again I am assuming formfield dropdowns) it may be worthwhile to do a Sub with a Select Case on the result of DD1, and change DD2 to match.

Linking dropdowns seems to come up frequently, gulp, maybe I should do a FAQ.


Gerry
 
Thanks for your help Fumei,
yes, what we have are documents with some 6 dropdowns per doc, not userforms. Historical only meant that they were made years ago, maybe with Word97 or even Word6 when possibly not all today's fancy feaures were available. The core of the text remains the same (with alterations possible), but the people in charge & their positions are not always the same and are chosen via dropdowns.
Now I inserted an image, which can be made non-printable and reacts on a double-click. It works, but it is not very elegant.

I see that a dropdown offers a possibility of running a macro "on event" and "on exit" but I never managed to trigger it off. Could you help with a hint here pls?

Many thanks again

ZH
 
I was going to write something out here, but you saved me the time. Thanks Anne!

The link Anne suplied gives a basic demonstration of how to make the result of one formfield deterime the result of another.

I am still a wee bit confused though. OK, you have 6 dropdowns, of which some are linked logically:

If Name = Mike Then Job = Engineer.

1. What are the 6 dropdowns, and are they all logically linked?
2. Are the dropdowns named appropriately for what they hold? (NOT "DropDown1" with "Williams", "Hart", "McDonald"...but, "LastName" with "Williams", "Hart", "McDonald"...

3. Are these going back out to users who are going to change the results of the dropdowns? Or are you doing this?

4. Are the dropdowns in one document the same in all of them? I am not talking about other areas of the document, just the dropdowns themselves.

Take a good look at what you need to happen. Check out the link Anne posted. If you get too lost, post back here. Specifically, to use an OnExit macro, the macro must exist (i.e. written and/or recorded). Right click (or Shift-F10) on the dropdown, select Properties. There are two boxes for calling macros, Entry and OnExit. Select the macro you want to run.



Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top