Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Jeff Kunberger Jeff Kunberger is offline
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


  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
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   Report Post  
Posted to microsoft.public.word.docmanagement
Jeff Kunberger[_2_] Jeff Kunberger[_2_] is offline
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   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey Greg Maxey is offline
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   Report Post  
Posted to microsoft.public.word.docmanagement
Jeff Kunberger[_2_] Jeff Kunberger[_2_] is offline
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   Report Post  
Posted to microsoft.public.word.docmanagement
Heather Bardeleben, Wolters Kluwer Heather Bardeleben, Wolters Kluwer is offline
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




Reply
Thread Tools
Display Modes

Posting Rules

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 07:37 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"