Pull Column 1 from a combo Box and display in a Query!

M

Marcelo

Hello,
I want to display Column 1 of my Combo box in a Query.

Query----- Error @ [Forms]![F_new_inv]![Model.column(1)]

SELECT DISTINCT tbl_FC_ImportData_2a.AssetID, tbl_FC_ImportData_2a.Tech,
tbl_FC_ImportData_2a.[Tech ID], tbl_FC_ImportData_2a.Date,
tbl_FC_ImportData_2a.Cube, tbl_FC_ImportData_2a.IC, tbl_FC_ImportData_2a.SN,
[Forms]![F_new_inv]![Model.column(1)] AS Model, tbl_Model.M_Model,
tbl_FC_ImportData_2a.Last_Comment_date, tbl_FC_ImportData_2a.Comment
FROM tbl_FC_ImportData_2a, tbl_Model;


If I leave it as [Forms]![F_new_inv]![Model] it works but I get column 0 of
the combo box and does not help me.

Help!!! Please

Thank you
Marcelo
 
J

Jeff Boyce

Is there a chance that the zero-based counting for .Column(#) is causing
this? Remember that .Column(0) refers to the first column ...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
M

Marcelo

Perhaps im doing something incorrect but when I add .column(#) I get a
Undefined function 'forms!F_new_inv!Model.column' in expression.

???

Thank you
Marcelo

Jeff Boyce said:
Is there a chance that the zero-based counting for .Column(#) is causing
this? Remember that .Column(0) refers to the first column ...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Marcelo said:
Hello,
I want to display Column 1 of my Combo box in a Query.

Query----- Error @ [Forms]![F_new_inv]![Model.column(1)]

SELECT DISTINCT tbl_FC_ImportData_2a.AssetID, tbl_FC_ImportData_2a.Tech,
tbl_FC_ImportData_2a.[Tech ID], tbl_FC_ImportData_2a.Date,
tbl_FC_ImportData_2a.Cube, tbl_FC_ImportData_2a.IC,
tbl_FC_ImportData_2a.SN,
[Forms]![F_new_inv]![Model.column(1)] AS Model, tbl_Model.M_Model,
tbl_FC_ImportData_2a.Last_Comment_date, tbl_FC_ImportData_2a.Comment
FROM tbl_FC_ImportData_2a, tbl_Model;


If I leave it as [Forms]![F_new_inv]![Model] it works but I get column 0
of
the combo box and does not help me.

Help!!! Please

Thank you
Marcelo
 
D

Duane Hookom

I don't think the query can handle anything but the bound column. I generally
add a textbox (maybe invisible) to the form.
Name: txtModelC2
Control Souce: Model.column(1)
Then in your query, use:
[Forms]![F_new_inv]![txtModelC2]
--
Duane Hookom
Microsoft Access MVP


Marcelo said:
Perhaps im doing something incorrect but when I add .column(#) I get a
Undefined function 'forms!F_new_inv!Model.column' in expression.

???

Thank you
Marcelo

Jeff Boyce said:
Is there a chance that the zero-based counting for .Column(#) is causing
this? Remember that .Column(0) refers to the first column ...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Marcelo said:
Hello,
I want to display Column 1 of my Combo box in a Query.

Query----- Error @ [Forms]![F_new_inv]![Model.column(1)]

SELECT DISTINCT tbl_FC_ImportData_2a.AssetID, tbl_FC_ImportData_2a.Tech,
tbl_FC_ImportData_2a.[Tech ID], tbl_FC_ImportData_2a.Date,
tbl_FC_ImportData_2a.Cube, tbl_FC_ImportData_2a.IC,
tbl_FC_ImportData_2a.SN,
[Forms]![F_new_inv]![Model.column(1)] AS Model, tbl_Model.M_Model,
tbl_FC_ImportData_2a.Last_Comment_date, tbl_FC_ImportData_2a.Comment
FROM tbl_FC_ImportData_2a, tbl_Model;


If I leave it as [Forms]![F_new_inv]![Model] it works but I get column 0
of
the combo box and does not help me.

Help!!! Please

Thank you
Marcelo
 
J

Jeff Boyce

If you used, literally, the "#", Access won't understand.

Look up Column() in Access HELP for correct syntax and example.

Regards

Jeff Boyce
Microsoft Office/Access MVP

Marcelo said:
Perhaps im doing something incorrect but when I add .column(#) I get
a
Undefined function 'forms!F_new_inv!Model.column' in expression.

???

Thank you
Marcelo

Jeff Boyce said:
Is there a chance that the zero-based counting for .Column(#) is causing
this? Remember that .Column(0) refers to the first column ...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Marcelo said:
Hello,
I want to display Column 1 of my Combo box in a Query.

Query----- Error @ [Forms]![F_new_inv]![Model.column(1)]

SELECT DISTINCT tbl_FC_ImportData_2a.AssetID,
tbl_FC_ImportData_2a.Tech,
tbl_FC_ImportData_2a.[Tech ID], tbl_FC_ImportData_2a.Date,
tbl_FC_ImportData_2a.Cube, tbl_FC_ImportData_2a.IC,
tbl_FC_ImportData_2a.SN,
[Forms]![F_new_inv]![Model.column(1)] AS Model, tbl_Model.M_Model,
tbl_FC_ImportData_2a.Last_Comment_date, tbl_FC_ImportData_2a.Comment
FROM tbl_FC_ImportData_2a, tbl_Model;


If I leave it as [Forms]![F_new_inv]![Model] it works but I get column
0
of
the combo box and does not help me.

Help!!! Please

Thank you
Marcelo
 
M

Marcelo

That will work thank you very much.....

Duane Hookom said:
I don't think the query can handle anything but the bound column. I generally
add a textbox (maybe invisible) to the form.
Name: txtModelC2
Control Souce: Model.column(1)
Then in your query, use:
[Forms]![F_new_inv]![txtModelC2]
--
Duane Hookom
Microsoft Access MVP


Marcelo said:
Perhaps im doing something incorrect but when I add .column(#) I get a
Undefined function 'forms!F_new_inv!Model.column' in expression.

???

Thank you
Marcelo

Jeff Boyce said:
Is there a chance that the zero-based counting for .Column(#) is causing
this? Remember that .Column(0) refers to the first column ...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Hello,
I want to display Column 1 of my Combo box in a Query.

Query----- Error @ [Forms]![F_new_inv]![Model.column(1)]

SELECT DISTINCT tbl_FC_ImportData_2a.AssetID, tbl_FC_ImportData_2a.Tech,
tbl_FC_ImportData_2a.[Tech ID], tbl_FC_ImportData_2a.Date,
tbl_FC_ImportData_2a.Cube, tbl_FC_ImportData_2a.IC,
tbl_FC_ImportData_2a.SN,
[Forms]![F_new_inv]![Model.column(1)] AS Model, tbl_Model.M_Model,
tbl_FC_ImportData_2a.Last_Comment_date, tbl_FC_ImportData_2a.Comment
FROM tbl_FC_ImportData_2a, tbl_Model;


If I leave it as [Forms]![F_new_inv]![Model] it works but I get column 0
of
the combo box and does not help me.

Help!!! Please

Thank you
Marcelo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top