Dynamic assignment of Control name

G

Gina Meyer

Hi.
I am trying to use the below structure to assign numbers to my control for
not having to duplicate code.

For i = 1 To 10
ThisDocument.["ComboBox" & i].AddItem strEntry
ThisDocument.["ComboBox" & i].ListIndex = 0
'ThisDocument.ComboBox2.AddItem strEntry
'ThisDocument.ComboBox2.ListIndex = 0
'...
Next i

How is this done the right way ???

Many thanks for your answers :)

Gina
 

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