Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Columns in a combo box

Status
Not open for further replies.

Razor1

IS-IT--Management
Nov 21, 2002
81
US
I have one combo box that is dependent on a second box. I have read the articles on how to do this I am curious why referring to the column in a query doesn't work.

This works in a RowSource on a Combo Box

SELECT tbl_IP_Profile.AssemblyCode, tbl_IP_Profile.LineID FROM tbl_IP_Profile WHERE (((tbl_IP_Profile.AssemblyCode)=[Forms]![frm_ReportProduction]![cbo_ProdDivision]));

When I change the select statement to:

SELECT tbl_IP_Profile.AssemblyCode, tbl_IP_Profile.LineID FROM tbl_IP_Profile WHERE (((tbl_IP_Profile.AssemblyCode)=[Forms]![frm_ReportProduction]![cbo_ProdDivision].Column(0)));

I get the following error.
Undefined function!frm_ReportProduction!cbo_ProdDivision.column in expression






Razor1
 
The Column() seems to be valid only in the form and code in the form.

Are you asking for a work around? If so, you might try wrap the reference in Eval()
Code:
=Eval([Forms]![frm_ReportProduction]![cbo_ProdDivision].Column(0))

I typically add a text box on the form with a control source of
=[cbo_ProdDivision].Column(0)
and then just reference the text box rather than the combo box.

You can always reference the bound column value by simply leaving off the column().


Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top