Parameter Value in Crosstab Query

  • Thread starter Thread starter NEWER USER
  • Start date Start date
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.
 
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];
 
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.
 
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 . . .
 
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 . . .
 
Back
Top