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 / February 2006

Tip: Looking for answers? Try searching our database.

Combobox items automatically clear every time I close Word doc.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
chowgirl - 31 Jan 2006 23:02 GMT
There is something very easy and basic here. My comboboxes have
hard-coded items and the code as entered in Design Mode is as follows:

Private Sub ComboBox1_Change()
ComboBox1.List = Array("Functional", "Look and feel", "Usability",
"Performance", "Operational", "Maintenance", "Security", "Legal",
"Other")
End Sub

Private Sub ComboBox2_Change()
ComboBox2.List = Array("1", "2", "3", "4", "5")
End Sub

Private Sub ComboBox3_Change()
ComboBox3.List = Array("1", "2", "3", "4", "5")
End Sub

Problem: Every time I close the file and re-open, the selections are
cleared. I have to enter Design Mode and Run the Form to get them back.
How do I keep the dropdown list populated?

Thanks.
Chuck Henrich - 01 Feb 2006 12:21 GMT
Have you tried using the userform's Initialize event to populate your
comboboxes?  The Initialize event will populate your combos before the form
displays.  By using the Change event your comboboxes will only populate when
you change the contents somehow.  The Change event can be useful to populate
other combo or list boxes depending on the values value you enter or select
in a particular combo or list box, but wouldn't normally be used to populate
the combo or list the user is selecting from/typing into.

Private Sub UserForm_Initialize()

ComboBox1.List = Array( _
                       "Functional", _
                       "Look and feel", _
                       "Usability", _
                       "Performance", _
                       "Operational", _
                       "Maintenance", _
                       "Security", _
                       "Legal", _
                       "Other")
ComboBox2.List = Array("1", "2", "3", "4", "5")
ComboBox3.List = Array("1", "2", "3", "4", "5")

End Sub

Signature

Chuck Henrich
www.ProductivityApps.com
Stylist Style Generator - automatically create and define sets of paragraph
numbering and heading styles

> There is something very easy and basic here. My comboboxes have
> hard-coded items and the code as entered in Design Mode is as follows:
[quoted text clipped - 18 lines]
>
> Thanks.
 
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.