Group:  Microsoft Word ยป microsoft.public.word.vba.userforms
Thread: combo boxes

Geek News

combo boxes
bgomezesthela 12/30/2008 11:06:00 PM
Hi,

I have posted this at two sites and I am totally new to this form things,
macros, combo boxes etc.... so I am creating a user form with 20 combo boxes.
All of them have more than 3 options some the same options but in different
questions. I did the first combo box and it's working fine problem is when I
try to create the 2nd, 3rd and so on. This is the thing that I am using for
the 1st combobox:

Private Sub ComboBox1_Initialize()
On Error Resume Next
With ComboBox1
.AddItem "New User"
.AddItem "Change User"
End With
End Sub

It works as I wanted to work. That one was easy :-)

Problem is with the second one I have tried several ways to do it and here
they are:

Private Sub UserForm_Change()
' set up the combo box list
With ComboBox2
ComboBox2.AddItem "Audit/Auditors (External Internal)"
ComboBox2.AddItem "Ben Admin/BA Director"
ComboBox2.AddItem "Ben Admin/BA Supervisor"
ComboBox2.AddItem "Ben Admin/Ben Calc/Death/Enrollment Team"
ComboBox2.AddItem "Ben Admin / Disability"
ComboBox2.AddItem "Ben Admin / Drop / DRO"
ComboBox2.AddItem "Ben Admin/Employer Services"
ComboBox2.AddItem "Ben Admin/Health Admin"
ComboBox2.AddItem "Ben Admin/Imaging/Records Distrib"
ComboBox2.AddItem "Ben Admin/Special Projects"
ComboBox2.AddItem "IS/Administration"
ComboBox2.AddItem "IS/Business Analyst"
ComboBox2.AddItem "IS/Data Analyst"
ComboBox2.AddItem "IS/IT Director"
ComboBox2.AddItem "Finance Admin / CFO"
ComboBox2.AddItem "Finance Admin/Financial Administration"
ComboBox2.AddItem "Finance Admin/Financial Reporting"
ComboBox2.AddItem "Finance Admin / Payroll"
ComboBox2.AddItem "Legal/DRO/Disability"
ComboBox2.AddItem "Legal/General"
ComboBox2.AddItem "Member Services/Call Center-Reception"
ComboBox2.AddItem "Member Services / Counseling"
ComboBox2.AddItem "Member Services / Director"
..ListIndex = 0
End With
End Sub

*This is one that I am trying but in this one it populates the combobox but
when I click on one option for testing all the entries duplicate. I am also
puting click instead of change and the same thing happens.

Can someone help me with this? I would really appreciated since I am goingt
nuts thak you so much





Re: combo boxes
Helmut Weber <red.sys[ at ]t-online.de> 12/31/2008 12:26:13 PM
Hi,

try putting your code in

Private Sub UserForm_Initialize()

--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net