Need To Dynamically Populate Values into a Combo Box

V

vmegha

Hi,

Need Help.

I'm dynamically adding a list of Combo Boxes to a form, against a list
of Labels ( Using Array AccArray)

I'm unable to initialise the drop down list ( Using Array - OpArray)
for the combo Box. I tried a couple of things. But they aren't working

For i = LBound(AccArray) To UBound(AccArray)
Set NewComboBox =
TempForm.Designer.Controls.Add("forms.ComboBox.1")
Set NewLabel = TempForm.Designer.Controls.Add("forms.Label.1")
With NewComboBox
.Width = 50
.Height = 15
.Left = 50
.Top = TopPos
.Tag = AccArray(i)
.AutoSize = True
.List = OpArray
End With
With NewLabel
.......
End With
Next i

I also tried ...
With NewComboBox
.Width = 50
.Height = 15
.Left = 50
.Top = TopPos
.Tag = AccArray(i)
.AutoSize = True
For j = LBound(OpArray) To UBound(OpArray)
NewComboBox.AddItem(OpArray(i))
Next j
End With

I'm new to this, so I might have mad e a silly mistake. Could anyone
please help?

-Megha
 

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