Error message instead of parameter box appearing

G

Guest

I am getting the following error message:
The Microsoft Jet database engine does not recognize ‘[Enter BU#:]’ as a
valid field name or expression.

Instead of the parameter box [Enter BU#:]

Any help much appreciated. SQL follows.

SELECT [Chart of Accounts].[Acct Desc], [JDE BU ABA's].[BR#], [JDE BU
ABA's].[ABA Name], PRODDTA_F0911.GLDCT, PRODDTA_F0911.GLDOC,
PRODDTA_F0911.GLPOST, PRODDTA_F0911.GLICU,
CJulian2Date(Right([GLDGJ],3),2000+(Left([GLDGJ],3)-100)) AS [Date],
PRODDTA_F0911.GLOBJ, PRODDTA_F0911.GLSBL, PRODDTA_F0911.GLPN,
PRODDTA_F0911.GLFY, PRODDTA_F0911.GLCN, PRODDTA_F0911.GLEXA,
PRODDTA_F0911.GLEXR, [GLAA]/100 AS Amount
FROM [Chart of Accounts] RIGHT JOIN ((PRODDTA_F0911 INNER JOIN [Reporting
Month Query] ON (PRODDTA_F0911.GLFY = [Reporting Month Query].Year) AND
(PRODDTA_F0911.GLPN = [Reporting Month Query].[RM Mo])) INNER JOIN [JDE BU
ABA's] ON PRODDTA_F0911.GLMCU = [JDE BU ABA's].MCMCU) ON [Chart of
Accounts].[Acct #] = PRODDTA_F0911.GLOBJ
WHERE ((([JDE BU ABA's].[BR#])=[ENTER BU:]) AND
((PRODDTA_F0911.GLOBJ)="6135" Or (PRODDTA_F0911.GLOBJ)>"6699"));
 
J

John Spencer

I suspect that you have a crosstab query buried in there someplace. If so, you
must declare your parameters in all the queries.

Parameters [Enter BU: ] Long;
SELECT [Chart of Accounts].[Acct Desc], [JDE BU ABA's].[BR#], [JDE BU
ABA's].[ABA Name], PRODDTA_F0911.GLDCT, PRODDTA_F0911.GLDOC,
PRODDTA_F0911.GLPOST, PRODDTA_F0911.GLICU,
CJulian2Date(Right([GLDGJ],3),2000+(Left([GLDGJ],3)-100)) AS [Date],
PRODDTA_F0911.GLOBJ, PRODDTA_F0911.GLSBL, PRODDTA_F0911.GLPN,
PRODDTA_F0911.GLFY, PRODDTA_F0911.GLCN, PRODDTA_F0911.GLEXA,
PRODDTA_F0911.GLEXR, [GLAA]/100 AS Amount
FROM [Chart of Accounts] RIGHT JOIN ((PRODDTA_F0911 INNER JOIN [Reporting
Month Query] ON (PRODDTA_F0911.GLFY = [Reporting Month Query].Year) AND
(PRODDTA_F0911.GLPN = [Reporting Month Query].[RM Mo])) INNER JOIN [JDE BU
ABA's] ON PRODDTA_F0911.GLMCU = [JDE BU ABA's].MCMCU) ON [Chart of
Accounts].[Acct #] = PRODDTA_F0911.GLOBJ
WHERE ((([JDE BU ABA's].[BR#])=[ENTER BU:]) AND
((PRODDTA_F0911.GLOBJ)="6135" Or (PRODDTA_F0911.GLOBJ)>"6699"));

By the way, is it Enter BU: or Enter BU#: ? It is one thing in the query you
posted and another in your text. I guessed that this is a long integer value,
so if it is a string change the "Long" to "Text ( 255)"
 
Top