Solved

Populate Combo box

Posted on 2014-10-09
3
90 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

752 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