By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,679 Members | 2,602 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,679 IT Pros & Developers. It's quick & easy.

Crosstab Query Criteria

P: n/a
Can a textbox on a form be referenced as the criteria for a field in a crosstab
query? When I use an expression like Forms!PFrmCriteria!Criteria, an error
message appears saying Access can not recognize 'Forms!PFrmCriteria!Criteria' as
a field or expression. However, if I put in the actual value of the criteria in
the crosstab query, the query runs fine.

Thank you!

Susan
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Susan wrote:
Can a textbox on a form be referenced as the criteria for a field in a crosstab
query? When I use an expression like Forms!PFrmCriteria!Criteria, an error
message appears saying Access can not recognize 'Forms!PFrmCriteria!Criteria' as
a field or expression. However, if I put in the actual value of the criteria in
the crosstab query, the query runs fine.


The form the query's parameter is reading must be open & have a valid
value in the control.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

Nov 12 '05 #2

P: n/a
For a cross-tab query, the references must be declared explicitly.
Use the little dialog box under Query - Parameters.

HTH
- Turtle

"Susan" <sm*****@earthlink.net> wrote in message
news:xy*******************@newsread1.news.atl.eart hlink.net...
Can a textbox on a form be referenced as the criteria for a field in a crosstab query? When I use an expression like Forms!PFrmCriteria!Criteria, an error
message appears saying Access can not recognize 'Forms!PFrmCriteria!Criteria' as a field or expression. However, if I put in the actual value of the criteria in the crosstab query, the query runs fine.

Thank you!

Susan

Nov 12 '05 #3

P: n/a
On Thu, 26 Feb 2004 01:00:13 GMT, "Susan" <sm*****@earthlink.net>
wrote:
Can a textbox on a form be referenced as the criteria for a field in a crosstab
query? When I use an expression like Forms!PFrmCriteria!Criteria, an error
message appears saying Access can not recognize 'Forms!PFrmCriteria!Criteria' as
a field or expression. However, if I put in the actual value of the criteria in
the crosstab query, the query runs fine.


For any query you *can* specify the query's Parameters collection; for
a Crosstab query you *must* do so.

Right mouseclick the grey background of the tables and select
Parameters from the menu you'll see. Add the Forms!... reference (copy
and paste it from the criteria line, it must match precisely) and
specify the datatype (date, number, whatever).

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.