Using column property in SQL

cokeblue8

Registered User.
Local time
Today, 01:00
Joined
Aug 28, 2007
Messages
38
Hi all

I have searched through this forum and on google, and I know that I can refer to a combobox's column property IN VBA by

[myform]![mycombobox].column(1)

When I do this in SQL, it complains that there is an "unidentified function" (column). What am I doing wrong?
 
Hi all

I have searched through this forum and on google, and I know that I can refer to a combobox's column property IN VBA by

[myform]![mycombobox].column(1)

When I do this in SQL, it complains that there is an "unidentified function" (column). What am I doing wrong?
What do you mean, "When I do this in SQL?" Are you saying, if you refer to a control within a SQL Statement? If so, then post your SQL as you probably just have the way your incorporating it wrong.
 
to reference a control on a form in a query you need the below syntax

Forms![FormName]![ControlName].Columns(1)
 
Bob, here is what I have as my rowsource for combobox #2:

SELECT tblName.LineID, tblName.Name
FROM tblLine
INNER JOIN tblName ON tblLine.LINE_ID = tblName.LineID
WHERE (tblLine.LINE_ID=[forms]![frm]![subfrm].[form]![cboLine].column(0));

Keith, I still get the same error message about an unidentified function when I try it your way.

Thanks for your replies!
 
Last edited:

Users who are viewing this thread

Back
Top Bottom