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 2005

Tip: Looking for answers? Try searching our database.

Single pull down list for multiple pull downs

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ScottP - 14 Mar 2005 16:46 GMT
I'm sure this question has come up but I've had no luck
finding it.

The question, how would I have a single list that could
be used to look up for multiple pull downs in my userform?

thanks,

ScottP
Jonathan West - 14 Mar 2005 16:58 GMT
> I'm sure this question has come up but I've had no luck
> finding it.
>
> The question, how would I have a single list that could
> be used to look up for multiple pull downs in my userform?

Do you mean by this that you want the content of other pulldowns to be set
according to the selected value of one?

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org 

ScottP - 14 Mar 2005 17:55 GMT
Sorry for the confusion:

List of Items:
Shoes
Shirt
Jeans
Socks

I would like to only type this list once and be able to
use it over and over in the form (where need be) without  
having to retype the list contents in the drop down field
properties.

Thanks,

ScottP
>-----Original Message-----
>
[quoted text clipped - 6 lines]
>Do you mean by this that you want the content of other pulldowns to be set
>according to the selected value of one?
Jonathan West - 14 Mar 2005 18:11 GMT
> Sorry for the confusion:
>
[quoted text clipped - 8 lines]
> having to retype the list contents in the drop down field
> properties.

Do you mean a form (i.e. a document with checkboxes, pulldowns etc), or a
UserForm (custom dialog)?

I suspect you mean a form, in which case you should take a look at this
article

Please Fill Out This Form
Create professional-looking forms in Word.
http://www.computorcompanion.com/LPMArticle.asp?ID=22

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org 

Jean-Guy Marcil - 17 Mar 2005 05:49 GMT
ScottP was telling us:
ScottP nous racontait que :

> I'm sure this question has come up but I've had no luck
> finding it.
>
> The question, how would I have a single list that could
> be used to look up for multiple pull downs in my userform?

Build your userform, then for each drop down where you want the same list,
use the control's tag property. In this example I used  a tag named "MyDrop"
(In the property windows in the VBE, each control you select has a Tag
property. In fact, you can select all the dropdown you want to at the same
time and enter the tag value only once for all of them.
Finally, in the initialize event of the userform, try some code like this:

'_______________________________________
Dim MyCtrl As Control
Dim MyArray As Variant

MyArray = Array("Select an item", "Item 1", "Item 2", "Item 3", "Item 4",
"Item 5", "Item 6")

For Each MyCtrl In Me.Controls
   If MyCtrl.Tag = "MyDrop" Then
       MyCtrl.List() = MyArray
       MyCtrl.ListIndex = 0
   End If
Next
'_______________________________________

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

 
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.