Need help referencing a column in a combo box in a querry.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all:
I need to know who to reference the 5th column in a combo box to use the
value in an update querry.

The name of the combo box is: cmbOrigReq
Tha name of the form the combo is on is: frmReqSel

I can get a msgbox to display the value of the 5th column with the code:
MsgBox Me.cmbOrigReq.Column(5)

Like I said above I need to run an update querry on the value of the 5th
column. I have tried the following:
[Forms]![frmReqSel]![cmbOrigReq].[Column(5)] - acts as if it was a parameter
querry

[Forms]![frmReqSel]![cmbOrigReq].Column(5) - responds that the code is an
invalid function.

How do I reference the 5th column in the combo box mentioned above in an
update querry?

Any help would be greatly appreciated.

Thanks,
FatMan
 
FatMan said:
Hi all:
I need to know who to reference the 5th column in a combo box to use the
value in an update querry.

The name of the combo box is: cmbOrigReq
Tha name of the form the combo is on is: frmReqSel

I can get a msgbox to display the value of the 5th column with the code:
MsgBox Me.cmbOrigReq.Column(5)

Like I said above I need to run an update querry on the value of the 5th
column. I have tried the following:
[Forms]![frmReqSel]![cmbOrigReq].[Column(5)] - acts as if it was a parameter
querry

[Forms]![frmReqSel]![cmbOrigReq].Column(5) - responds that the code is an
invalid function.

How do I reference the 5th column in the combo box mentioned above in an
update querry?

Any help would be greatly appreciated.

You might be able to use...

Eval([Forms]![frmReqSel]![cmbOrigReq].Column(5))

....but what I usually do is add a hidden TextBox to the form with a
ControlSource of...

=ComboBoxName.Column(5)

....and then I reference the hidden control in the query instead of the ComboBox.
 
Back
Top