Solved

Populate Combo box

Posted on 2014-10-09
3
92 Views
Last Modified: 2014-10-10
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
0
Comment
Question by:b001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 3

Accepted Solution

by:
jcrozier21 earned 500 total points
ID: 40371808
'populate
dim i as integer
i=0
do while i < 3
combo.AddItem fee_str(i,0) & ";" & fee_str(i,1)
i=i+1
loop

Open in new window


dim secondColumnValue as string
secondColumnValue = combo.column(1)

Open in new window

0
 
LVL 12

Expert Comment

by:jkaios
ID: 40371896
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

0
 

Author Comment

by:b001
ID: 40372710
i have error

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

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month8 days, 1 hour left to enroll

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question