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

Crosstab Query problem 1

Status
Not open for further replies.

stupiet

Programmer
Aug 21, 2001
176
US
I am clueless why this error is occurring when running my query. It worked when I first created it, but now it won't do anything.

This is what I did:
I created a Query ("DeptList") that narrows down the search based on a date range inputted on a form. This one works fine.


Then I created a crosstab query based on "DeptList" where I count the number of cards submitted by department sorted by card type. Department is the row heading, card type is the column heading.

Now when I run the crosstab query it tells me that "MS Jet Database engine does not recognize "[Forms]![RunReport]![StartDate]" as a valid field name or expression".
If I replace the criteria in the DeptList Query to an actual date rather than referencing a field from a form, the crosstab query runs just fine.
I have double checked the form field many times and it does not seem to be a typo or anything.

Anybody knows what is going on? Can you not create crosstabs based on an input from a form?

Please help.

Thanks,

Stupiet
 
You need to declare that [forms]![runreport]![startdate] in the crosstab query as a parameter and type would be DATE.
 
Knicks,

Thanks for helping.
This might sound stupid, but how do you do that?
 
Just right mouse click in the query pane area (the whole middle to top), select parameters. Then type in [Forms]![RunReport]![StartDate] and choose type DATE
 
or choose from Menu

Query
Parameters

and follow above directions...
 
Thanks Knicks!

It's working. Wish I would have contacted you sooner, it would have saved a bunch of headaches!
 
Yeah, I've been down that road before.

Its always good to give the old college try first, sharpens the law of deduction.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top