Combobox items automatically clear every time I close Word doc.

C

chowgirl

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.
 
C

Chuck Henrich

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top