Solved

Setting up a combo box with multiple database columns

Posted on 2001-09-17
5
191 Views
Last Modified: 2010-05-02
I need to use a combo box (and / or list box) that when you select the dropdown arrow, multiple database columns are listed. For example, an ID field, and a description field. But when you select a record, only one of the database columns would be bound to that control?
0
Comment
Question by:charming
  • 3
  • 2
5 Comments
 
LVL 5

Expert Comment

by:rkot2000
ID: 6487891
I am using sheridan combo to display colums.
why do need to display an id field?
0
 
LVL 2

Expert Comment

by:uncle_med
ID: 6487947
You can do it using Forms 2 component. Go to Components from Project menu and select Microsoft Forms 2 Object Library. I'll have a look to see if I have any code examples for you.
0
 
LVL 5

Expert Comment

by:rkot2000
ID: 6487975
According to Microsoft License Agreement you can not distribute Microsoft forms to users. Users must have Office installed.
0
 
LVL 2

Accepted Solution

by:
uncle_med earned 85 total points
ID: 6487985
OK Charming

After selecting forms 2 from components. Create a forms2 combo on your form. Call it cmb. In it's properties make the columncount property 2 (You can do it through code). Then copy and paste this onto your form_load

Private Sub Form_Load()
    cmb.AddItem
    cmb.List(0, 0) = "R1C1"
    cmb.List(0, 1) = "R1C2"
    cmb.AddItem
    cmb.List(1, 0) = "R2C1"
    cmb.List(1, 1) = "R2C2"
 
End Sub

Let me know what you think
0
 
LVL 2

Expert Comment

by:uncle_med
ID: 6487999
rKot2000 is right

You must have Office installed to use forms2. I assume you have office installed.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

932 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

12 Experts available now in Live!

Get 1:1 Help Now