I want to add comboboxes to a form based on the number of records in a db table. Each combo box is to be populated with the same choices. I found code for adding the comboboxes, but have been unable to determine how to add items to them.
I am adding the comboboxes with the code below:
I tried using
but that isn't available.
Can someone post or point me to instructions that I need?
Thanks
I am adding the comboboxes with the code below:
Code:
Private Sub AddControlSet()
Dim c As Control
c = New ComboBox()
c.Name = "cboInputFile"
c.Top = Me.Controls.Count + 1 * 25
c.Left = 5
c.Width = 125
Me.Controls.Add(c)
c.Text = "SELECT file"
c = New ComboBox()
c.Name = "cboIMSColumns"
c.Top = Me.Controls.Count + 1 * 25
c.Left = 5 + Me.Controls.Item(Me.Controls.Count - 1).Width + 5
c.Width = 125
Me.Controls.Add(c)
Me.Controls.Item(Me.Controls.Count - 1).Text = "Select File"
c = New Button
c.Name = "Rule"
c.Top = Me.Controls.Count + 1 * 25
c.Left = Me.Controls.Item(Me.Controls.Count - 1).Left + Me.Controls.Item(Me.Controls.Count - 1).Width + 5
c.Height = Me.Controls.Item(Me.Controls.Count - 1).Height
Me.Controls.Add(c)
Me.Controls.Item(Me.Controls.Count - 1).Text = "Rule"
End Sub
Code:
c.items.add
Can someone post or point me to instructions that I need?
Thanks