Sorry I should have included the step of assigning the value to the tag
property first. In the combobox AfterUpdate event, add this..
'x is the column you wish to retrive.
Me!cbxCtlID.Tag = Me!cbxCtlID.Column(x)
Then in your SQL statement use...
SELECT .<add fields to retrive>.. WHERE CtlID = Forms!frmMain!cbxCtlID.Tag;
Hope this makes more sense.
Mike Storr
www.veraccess.com
"Mike Storr" <st******@sympatico.ca> wrote in message
news:jx********************@news20.bellglobal.com. ..
If you are trying to do this from a QueryDef object (Queries Tab) then you
can only get at the value (bound column) of the control.
If you are not using the Tag property of the combobox, you could assign
the needed column to it, instead of creating another control.
example: SELECT ... WHERE CtlID = Forms!frmMain!cbxCtlID.Tag
Mike Storr
www.veraccess.com
"deko" <dj****@hotmail.com> wrote in message
news:ng*******************@newssvr27.news.prodigy. com... Can I reference a column other than the bound column of a ComboBox in a
query?
SELECT ... WHERE CtlID = Forms!frmMain!cbxCtlID.Column(1); (this does
not seem to work)
Or must I add a hidden text box on frmMain and use this:
Me.txtCtlID = Forms!frmMain!cbxCtlID.Column(1)
SELECT ... WHERE CtlID = Forms!frmMain!txtCtlID;