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

Criteria from ComboBox Column Values 2

Status
Not open for further replies.

agfon

Programmer
Mar 25, 2005
38
US
I'm trying to limit the results of a query by setting the criteria of three fields to the values of a ComboBox's columns.

I'm using similar syntax for each field...

[blue][forms].[myForm].[ComboBox1]![column(2)][/blue]

The problem is that the criteria returns a null (or blank) value. I've tried setting one of the columns to...

[blue]Expr1: [forms].[myForm].[ComboBox1]![column(2)][/blue]

When I run the query, the entire column is blank.

Where am I going wrong?

 
You can't access the Column property in a query.
In the AfterUpdate event procedure of ComboBox1 populates 3 hidden textbox you can refer to in your query.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Try using the Eval function:

[tt]Eval("[forms]![myForm]![ComboBox1].column(2)")[/tt]

- note the dot (.) between the combo name and column property, and the lack of [brackets] on the column property, and the bangs (!).

Roy-Vidar
 
Thanks, Roy-Vidar! It works great.
 
Good one Roy.
I thought that SandBox mode would block the Eval function, but apparently not.
A star for your brillant idea.
 
Thank you!
I can't claim to be the originator of the idea though. I'm sure I've picked it up somewhere, but I don't remember who to credit.

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top