crosstab query

  • Thread starter Thread starter Chad
  • Start date Start date
C

Chad

I have a problem, I created a crosstab query that looks
like this:

TRANSFORM Count([tblRoster_Live].[Badge]) AS CountOfBadge
SELECT [tblRoster_Live].[Program_Code], Count
([tblRoster_Live].[Badge]) AS [Total Of Badge]
FROM tblRoster_Live, tblDepts
WHERE [tblRoster_Live].[Dept]=[tblDepts].[Dept] And
[tblDepts].[Function]=[Forms]![frmProgramRoster]!
[cboFunction1]
GROUP BY [tblRoster_Live].[Program_Code]
PIVOT [tblRoster_Live].[Dept];

Whenever I run this code it says that the 'Microsoft Jet
Database Engine does not recognize '[Forms]!
[frmProgramRoster]![cboFunction1] as a valide field name
or expression'

I don't know why, I triple checked teh names were right
and that I called it right in the query. Also, if I
replace the [Forms]![frmProgramRoster]![cboFunction1]
with an actual value the query works.

Third of all, if I use that combo box in another query it
works fine as well so I gues me question would be how to
get this query to work.

Thanks
 
First thing, with a crosstab query you MUST declare your parameters and if any
other queries are used in the crosstab their parameters must also be declared.

Open the query in design mode
Select Query: Parameters from the Menu
Fill in the EXACT name of the parameter in column 1
Select the data type of the parameter in column 2
 
Back
Top