Link to home
Start Free TrialLog in
Avatar of b001
b001Flag for Afghanistan

asked on

Populate Combo box

HI Experts
I have 2 dimesional array

  Public fee_str(3, 2) As String
I wuould like to display in a combobox and store the selected rows second column value to arx
please help
ASKER CERTIFIED SOLUTION
Avatar of jcrozier21
jcrozier21
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To display contents of array in combo box (assuming the combo box is named Combo1):

Dim ii as Integer, jj as Integer
For ii = 0 to 3
   For jj = 0 to 2
     Combo1.AddItem fee_str(ii,jj)
   Next
Next

Open in new window


To display selected item in combo box:

Private Sub Combo1_Click()
   Debug.Print "selected item: " & Combo1.Text
   Debug.Print "selected item: " & Combo1.List(combo1.ListIndex)  'same as above
End Sub

Open in new window

Avatar of b001

ASKER

i have error

Error      1      'AddItem' is not a member of 'System.Windows.Forms.ComboBox'