?
Solved

VB 5.0 Forms 2.0 Object Library  Combo box.

Posted on 1998-04-02
1
Medium Priority
?
446 Views
Last Modified: 2008-02-01
 I would like to know how to fill the second column of the combo box contol in the Microsoft Forms 2.0 Object Library.
 I can display the 2 columns, and I can display the headers for each column, but I cannot fill the second column with any information.  Some sample code would be great.

   Also, how do you fill the headers?
0
Comment
Question by:jmccay
[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
1 Comment
 

Accepted Solution

by:
jcoppinger earned 800 total points
ID: 1460271
You must use the ColumnHeads property with the ListFillRange, Control Source, or Row Source properties to populate the headings.  These properties depend on data objects such as Excel worksheets.  You cannot populate the headings using properties or methods available in the Combobox itself.

Here is one way to populate multiple columns:

Private Sub Form_Load()
Dim data(9, 1) As String
Dim i

For i = 0 To 9
    data(i, 0) = CStr(i)
    data(i, 1) = "foo"
Next i
With ComboBox1
    .ColumnCount = 2
    .List() = CVar(data)
End With
End Sub

jc
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

800 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