Parameter Value in Crosstab Query

N

NEWER USER

I created a Select Query using a Parameter Value defined in my criteria
[Enter Group Number]. The records are retrieved when query runs. Now...

I take that query and build a Crosstab query using my select query as the
criteria. When it runs, I get an error message that [Enter Group Number] is
not recognized as a valid field name or expression. Are Parameter Values
allowed in Crosstab queries? Any help to steer me in the right direction is
appreciated.
 
J

Jerry Whittle

Recent versions of Access have become very picky with parameters and crosstabs.

Have you defined the [Enter Group Number] parameter data type specifically?
If so the SQL view of the initial query should look something like:

PARAMETERS [Enter Group Number] Integer;
SELECT tblDates.*
FROM tblDates
WHERE GroupNumber = [Enter Group Number];
 
D

Dale Fye

In addition to defining it in the original query (as Jerry mentioned), you
may also need to define it explicitly in the crosstab query.

----
HTH
Dale



Jerry Whittle said:
Recent versions of Access have become very picky with parameters and crosstabs.

Have you defined the [Enter Group Number] parameter data type specifically?
If so the SQL view of the initial query should look something like:

PARAMETERS [Enter Group Number] Integer;
SELECT tblDates.*
FROM tblDates
WHERE GroupNumber = [Enter Group Number];
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


NEWER USER said:
I created a Select Query using a Parameter Value defined in my criteria
[Enter Group Number]. The records are retrieved when query runs. Now...

I take that query and build a Crosstab query using my select query as the
criteria. When it runs, I get an error message that [Enter Group Number] is
not recognized as a valid field name or expression. Are Parameter Values
allowed in Crosstab queries? Any help to steer me in the right direction is
appreciated.
 
M

Marshall Barton

NEWER said:
I created a Select Query using a Parameter Value defined in my criteria
[Enter Group Number]. The records are retrieved when query runs. Now...

I take that query and build a Crosstab query using my select query as the
criteria. When it runs, I get an error message that [Enter Group Number] is
not recognized as a valid field name or expression. Are Parameter Values
allowed in Crosstab queries? Any help to steer me in the right direction is
appreciated.


Yes, you can, but, in crosstab queries, the parameters must
be declared:

PARAMETERS [Enter Group Number] INTEGER;
SELECT . . .
 
N

NEWER USER

Thanks for ALL the help guys...Happy Holidays!

Marshall Barton said:
NEWER said:
I created a Select Query using a Parameter Value defined in my criteria
[Enter Group Number]. The records are retrieved when query runs. Now...

I take that query and build a Crosstab query using my select query as the
criteria. When it runs, I get an error message that [Enter Group Number] is
not recognized as a valid field name or expression. Are Parameter Values
allowed in Crosstab queries? Any help to steer me in the right direction is
appreciated.


Yes, you can, but, in crosstab queries, the parameters must
be declared:

PARAMETERS [Enter Group Number] INTEGER;
SELECT . . .
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top