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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refer to column in query builder 2

Status
Not open for further replies.

Pampers

Technical User
Apr 7, 2004
1,300
AN
Hi everyone,
Can one refer to a column of combox in your query criterium field, like:

[Forms]![frmCompanyCost]![frmCompanyCostSub1].[Form]![CompanyCostTypeID]![column(1)]

I don't get an error message, but go no results either.

Pampers [afro]
Keeping it simple can be complicated
 
Hello:

[YourComboName].[Column](1)
Will give the item in column 1 of a combo box. So in your statement, maybe ....

[Forms]![frmCompanyCost]![frmCompanyCostSub1].[Form]![CompanyCostTypeID]![YourComboName].[Column](1)

Regards
Mark
 
Tnx Mark,
I will give it a try tomorrow at work. Keep you posted.


Pampers [afro]
Keeping it simple can be complicated
 
You can only refer to the bound column with that type of expression. The solution that I use is to create a text box on the form with a control source like:
=[CompanyCostTypeID]![column(1)
You can then use the text box in your query criteria. You can also use the Eval() function with the column reference.


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Hi DHookom,
Thanx for the info. That clears things up.

Well, that is what I did too (first solution) - create a textbox that refers to the column and refer that textbox in the query. Works ok.

Pampers [afro]
Keeping it simple can be complicated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top