A Microsoft Word forum. Microsoft Office Word Forum - WordBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Microsoft Office Word Forum - WordBanter forum » Microsoft Word Newsgroups » Microsoft Word Help
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Linking dropdown boxes (box 2 list dependent on box 1 choice)



 
 
Thread Tools Display Modes
  #1  
Old March 23rd 07, 02:47 PM posted to microsoft.public.word.docmanagement
Jeff Kunberger
external usenet poster
 
Posts: 1
Default Linking dropdown boxes (box 2 list dependent on box 1 choice)

I found two similar questions, but I still can't figure out the first
step...How to get the dropdown box1 to know to run the VBA code.

I add the ddb form field via the toolbar button, then click on the VB Editor
toolbar button...but that doesn't link anything.

I'm sure I'm missing something simple, but any help would be much appreciated.

Jeff


Ads
  #2  
Old March 23rd 07, 03:25 PM posted to microsoft.public.word.docmanagement
Jay Freedman
external usenet poster
 
Posts: 9,855
Default Linking dropdown boxes (box 2 list dependent on box 1 choice)

First write the macro that populates the second box based on the value
selected in the first box. Then open the Properties dialog of the first box
(most easily by double-clicking the box), look in the "Exit" dropdown, and
select the name of the macro you wrote. When the user tabs or mouse-clicks
out of the first box, the macro will run before the next form field gets the
focus.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Jeff Kunberger wrote:
I found two similar questions, but I still can't figure out the first
step...How to get the dropdown box1 to know to run the VBA code.

I add the ddb form field via the toolbar button, then click on the VB
Editor toolbar button...but that doesn't link anything.

I'm sure I'm missing something simple, but any help would be much
appreciated.

Jeff



  #3  
Old March 23rd 07, 04:36 PM posted to microsoft.public.word.docmanagement
Jeff Kunberger[_2_]
external usenet poster
 
Posts: 2
Default Linking dropdown boxes (box 2 list dependent on box 1 choice)

Okay,

So I add two drop down boxes to my document. Then go to the first drop down
box and input all the items to appear in that list.

Then I write the macro to look at the choice in ddb 1 and populate ddb 2
based on the choice?

The only vba code I found to do a cascading list box uses a table in a
different file. I dont' want to reference another document. I want just
input the data in the code, (ie. If Alpha, then display Apple, Alligator,
Audi; If Beta, then display Baseball, Book, Bumper..etc).

Any suggestions?
"Jay Freedman" wrote:

First write the macro that populates the second box based on the value
selected in the first box. Then open the Properties dialog of the first box
(most easily by double-clicking the box), look in the "Exit" dropdown, and
select the name of the macro you wrote. When the user tabs or mouse-clicks
out of the first box, the macro will run before the next form field gets the
focus.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Jeff Kunberger wrote:
I found two similar questions, but I still can't figure out the first
step...How to get the dropdown box1 to know to run the VBA code.

I add the ddb form field via the toolbar button, then click on the VB
Editor toolbar button...but that doesn't link anything.

I'm sure I'm missing something simple, but any help would be much
appreciated.

Jeff




  #4  
Old March 23rd 07, 05:14 PM posted to microsoft.public.word.docmanagement
Greg Maxey
external usenet poster
 
Posts: 264
Default Linking dropdown boxes (box 2 list dependent on box 1 choice)

Something like this:

Sub OnExitDD()
Dim oFF As FormFields
Set oFF = ActiveDocument.FormFields
oFF("Dropdown2").DropDown.ListEntries.Clear
Select Case oFF("Dropdown1").Result
Case "A"
With oFF("Dropdown2").DropDown.ListEntries
.Add "Apples"
.Add "Apricots"
.Add "Angel food cake"
End With
Case "B"
'
Case "C"
'
End Select
End Sub


On Mar 23, 11:36 am, Jeff Kunberger
wrote:
Okay,

So I add two drop down boxes to my document. Then go to the first drop down
box and input all the items to appear in that list.

Then I write the macro to look at the choice in ddb 1 and populate ddb 2
based on the choice?

The only vba code I found to do a cascading list box uses a table in a
different file. I dont' want to reference another document. I want just
input the data in the code, (ie. If Alpha, then display Apple, Alligator,
Audi; If Beta, then display Baseball, Book, Bumper..etc).

Any suggestions?



"Jay Freedman" wrote:
First write the macro that populates the second box based on the value
selected in the first box. Then open the Properties dialog of the first box
(most easily by double-clicking the box), look in the "Exit" dropdown, and
select the name of the macro you wrote. When the user tabs or mouse-clicks
out of the first box, the macro will run before the next form field gets the
focus.


--
Regards,
Jay Freedman
Microsoft Word MVP FAQ:http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.


Jeff Kunberger wrote:
I found two similar questions, but I still can't figure out the first
step...How to get the dropdown box1 to know to run the VBA code.


I add the ddb form field via the toolbar button, then click on the VB
Editor toolbar button...but that doesn't link anything.


I'm sure I'm missing something simple, but any help would be much
appreciated.


Jeff- Hide quoted text -


- Show quoted text -



  #5  
Old March 23rd 07, 08:01 PM posted to microsoft.public.word.docmanagement
Jeff Kunberger[_2_]
external usenet poster
 
Posts: 2
Default Linking dropdown boxes (box 2 list dependent on box 1 choice)

Thanks to Greg and Jay for all their help. I was able to get it working like
I wanted.

"Greg Maxey" wrote:

Something like this:

Sub OnExitDD()
Dim oFF As FormFields
Set oFF = ActiveDocument.FormFields
oFF("Dropdown2").DropDown.ListEntries.Clear
Select Case oFF("Dropdown1").Result
Case "A"
With oFF("Dropdown2").DropDown.ListEntries
.Add "Apples"
.Add "Apricots"
.Add "Angel food cake"
End With
Case "B"
'
Case "C"
'
End Select
End Sub


On Mar 23, 11:36 am, Jeff Kunberger
wrote:
Okay,

So I add two drop down boxes to my document. Then go to the first drop down
box and input all the items to appear in that list.

Then I write the macro to look at the choice in ddb 1 and populate ddb 2
based on the choice?

The only vba code I found to do a cascading list box uses a table in a
different file. I dont' want to reference another document. I want just
input the data in the code, (ie. If Alpha, then display Apple, Alligator,
Audi; If Beta, then display Baseball, Book, Bumper..etc).

Any suggestions?



"Jay Freedman" wrote:
First write the macro that populates the second box based on the value
selected in the first box. Then open the Properties dialog of the first box
(most easily by double-clicking the box), look in the "Exit" dropdown, and
select the name of the macro you wrote. When the user tabs or mouse-clicks
out of the first box, the macro will run before the next form field gets the
focus.


--
Regards,
Jay Freedman
Microsoft Word MVP FAQ:http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.


Jeff Kunberger wrote:
I found two similar questions, but I still can't figure out the first
step...How to get the dropdown box1 to know to run the VBA code.


I add the ddb form field via the toolbar button, then click on the VB
Editor toolbar button...but that doesn't link anything.


I'm sure I'm missing something simple, but any help would be much
appreciated.


Jeff- Hide quoted text -


- Show quoted text -




  #6  
Old November 30th 07, 05:37 PM posted to microsoft.public.word.docmanagement
Heather Bardeleben, Wolters Kluwer
external usenet poster
 
Posts: 1
Default Linking dropdown boxes (box 2 list dependent on box 1 choice)

Good morning Mr. Freedman,

I am trying to link drop down boxes in my Word 2003 document and would
greatly appreciate any help that you can provide. I am an experienced user,
but not a technical writer.

What I want to do is as follows:

ddb1 ddb3 ddb2

If x users (ddb1) is selected, than y $value (ddb3) is selected and z
training sessions (ddb2) is selected.

Can you please tell me how to do this?

"Jay Freedman" wrote:

First write the macro that populates the second box based on the value
selected in the first box. Then open the Properties dialog of the first box
(most easily by double-clicking the box), look in the "Exit" dropdown, and
select the name of the macro you wrote. When the user tabs or mouse-clicks
out of the first box, the macro will run before the next form field gets the
focus.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Jeff Kunberger wrote:
I found two similar questions, but I still can't figure out the first
step...How to get the dropdown box1 to know to run the VBA code.

I add the ddb form field via the toolbar button, then click on the VB
Editor toolbar button...but that doesn't link anything.

I'm sure I'm missing something simple, but any help would be much
appreciated.

Jeff




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I create dependent drop down boxes in Word 2003? vickory6 Microsoft Word Help 1 July 2nd 06 07:27 AM
Tutorial for Dropdown boxes in a Word table on the Web? RRR_News New Users 4 April 26th 06 03:06 PM
Hyperlinks in Word Dropdown Boxes Melon Microsoft Word Help 3 October 13th 05 08:41 AM
Expanding dropdown boxes - office. Mark Harding Microsoft Word Help 1 March 25th 05 04:20 PM
Linking dropdown form fields obiesugar Microsoft Word Help 1 December 7th 04 08:50 PM


All times are GMT +1. The time now is 03:53 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright 2004-2018 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.