display column 2 of unbound combo box in text box

flavi

Avg Access Guy
Local time
Today, 07:59
Joined
Jun 16, 2008
Messages
14
Hi. In the below picture, my field that says Vendor is cboVENDOR. Using cascading combo boxes, when the user selects the Vendor, the next cboPN shows the part number. I am looking to find a way to show the 2nd column of cboPART in the text field(Text 17) after it, which is called txtDES.

Here is the code for cboVENDOR after update:

Code:
Private Sub cboVENDOR_AfterUpdate()
Me.cboPN.RowSource = "SELECT fldPN, fldDESCRIPTION FROM" & _
                               " tblPARTS WHERE fldVENDORID = " & _
                               Me.cboVENDOR & _
                               " ORDER BY fldPN"
 
    Me.cboPN = Me.cboPN.ItemData(1)
End Sub

Then in txtDES(Text 17), I thought I would use the code in the control source:

Code:
=[Me].[cboPN].[1]

Is there a better way to get this to work?

I appreciate any help.

help2.png
 
Try changing:

Code:
=[Me].[cboPN].[1]

to

Code:
=[cboPN].Column(1)
 

Users who are viewing this thread

Back
Top Bottom