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

user criteria in crosstab query

Status
Not open for further replies.

MikeGK

Programmer
Nov 6, 2001
10
CY
I created a crosstab query and now I want to give the user the option to put criteria to filter the records to be included in the calculations.

I tried adding another column in my crosstab query and put criteria.
The user must choose a city from a combo box "city" on a form and the criteria on the field city of the query looks like [Forms]![ReportCriteria]![City]. Access doesn't accept this criterion and is giving me the message "The Microsoft Jet database engine does not recognize '[Forms]![ReportCriteria]![City]' as a valid field name or expression"

Is there a known limitation of access of not allowing user criteria in a crosstab query or am I doing something wrong?

 
under the field you added did you make sure under total field where the others say group by your new field needs to read where then you should be able to add the criteria
good luck
 
No, luck :)
The crosstab row is already set to "Where".
Any other ideas?

If I write a value (e.g 2) in the criteria row the query it works fine, but if I write [Forms]![ReportCriteria]![City] I'm getting this error message. I'm sure that the syntax of the criterion and the design of the combo box are correct because I've tried it in a Select query and it works.
 

I have found the answer myself on the microsoft knowledge base (Q209778). I just had to add the [Forms]![ReportCriteria]![City] to the Query Parameters.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top