PDA

View Full Version : Solved: Crosstab Query - Assistance with Criteria (Access '97)



phendrena
05-06-2009, 02:57 AM
Hi,

I am having a problem with some criteria used in a crosstab query. The code below should filter the Month (Row) based on the users choice in the Report Wizard form. When used in a simple query the code works fine.


IIf([Forms]![Report Wizard]![cboMonth]<>"",[Forms]![Report Wizard]![cboMonth],[Month])

When used in the crosstab query I get the following error :

'The microsoft jet database doesn't recognise '[Forms]![Report Wizard]![cboMonth]' as a valid field name or expression.

Where am I going wrong with the crosstab?

Thanks,

CreganTur
05-06-2009, 05:30 AM
Did you actually setup '[Forms]![Report Wizard]![cboMonth]' as a true parameter within yor query? Meaning, did you click Query-> Parameters, and enter it in that window (along with associated data type)? If you don't, the parameter will fail.

phendrena
05-06-2009, 06:00 AM
Did you actually setup '[Forms]![Report Wizard]![cboMonth]' as a true parameter within yor query? Meaning, did you click Query-> Parameters, and enter it in that window (along with associated data type)? If you don't, the parameter will fail.Hi Randy,

Thanks for the reply.
I hadn't set it up as a true parameter, it's not something i'd have know to do tbh. I've now added a parameter and it works nicely.

Cheers, :beerchug: