Solved

Populate Combo box

Posted on 2014-10-09
3
81 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
3 Comments
 
LVL 3

Accepted Solution

by:
jcrozier21 earned 500 total points
Comment Utility
'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
Comment Utility
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
Comment Utility
i have error

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

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
combo box display member not working 11 19
Need help with a query. 10 43
Tabcontrol Caption? 1 21
Library to convert HTML to PDF. 8 44
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now