Solved

VB 5.0 Forms 2.0 Object Library  Combo box.

Posted on 1998-04-02
1
431 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
1 Comment
 

Accepted Solution

by:
jcoppinger earned 200 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

775 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