Setting up a combo box with multiple database columns

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?
charmingAsked:
Who is Participating?
 
uncle_medConnect With a Mentor Commented:
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
 
rkot2000Commented:
I am using sheridan combo to display colums.
why do need to display an id field?
0
 
uncle_medCommented:
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
 
rkot2000Commented:
According to Microsoft License Agreement you can not distribute Microsoft forms to users. Users must have Office installed.
0
 
uncle_medCommented:
rKot2000 is right

You must have Office installed to use forms2. I assume you have office installed.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.