passing a control value to a parameter

gbshahaq

Sham
Local time
Today, 15:53
Joined
Apr 21, 2004
Messages
52
i have done this before with simpler databases but i am working on a database with about 30 tables and as many simple/crosstab queries.

i have a form with combo boxes, option boxes and listboxes.

I have a query where I enter the criteria:

[Forms]![Form_1]![ListMonth]

where "Listmonth" is a listbox on Form1, and a cmdbutton runs the query, i get an error message 3070:

"ms jet db engine does not recognize "[Forms]![Form_1]![ListMonth]" as a valid field name or expression"

Where am i going wrong? my query is fine (works without parameters or directly entered) and the names of the form/control have been checked.

BTW - i have tried this on NT 4.0 sp5/Access 97 and on XP Pro/Access 2002
Same result.... :-(

Can anyone help pls?
 
Ye ole parameter in the source of a crosstab query problem. Boy, if I had a quarter for every time I forgot this ... You must define the parameter in the query. Go up to the Query menu and select Parameters .... In the first column put in your [Forms]![Form_1]![ListMonth] and in the second column Date/Time. Save and you should be good to go.
 
i feel really stupid now...and grateful! thanks a lot!!!!

btw - I wonder why this has worked before WITHOUT me addressing the parameters.....

Sham :o


pdx_man said:
Ye ole parameter in the source of a crosstab query problem. Boy, if I had a quarter for every time I forgot this ... You must define the parameter in the query. Go up to the Query menu and select Parameters .... In the first column put in your [Forms]![Form_1]![ListMonth] and in the second column Date/Time. Save and you should be good to go.
 

Users who are viewing this thread

Back
Top Bottom