"Can't Bind Name '[XXX]'" Error Message with Crosstab Query (91710)
The information in this article applies to:
- Microsoft Access 1.0
- Microsoft Access 1.1
- Microsoft Access 2.0
- Microsoft Access for Windows 95 7.0
- Microsoft Access 97
This article was previously published under Q91710 Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
If you create a crosstab query that uses an implicit parameter [XXX] in a
WHERE clause (criteria), you may receive the following error message in Microsoft Access 97:
The Microsoft Jet database engine does not recognize '[XXX]' as a
valid field name or expression.
In earlier versions of Microsoft Access, you receive the following error message:
Can't bind name '[XXX]'
If you use an explicit parameter, the query works as expected.
CAUSE
A crosstab query dynamically generates column names. Therefore, Microsoft
Access cannot tell whether [XXX] refers to a parameter or to a column
name until after the query is bound.
When you build a graph, Microsoft Access uses a crosstab to build the data
to graph. If the query is a parameter query, you have to define the
parameters explicitly as you would have to for a typical crosstab query.
RESOLUTIONMethod 1
Define an Explicit Parameter:
To avoid this error, define [XXX] as an explicit parameter by adding it to
the Query Parameters dialog box.
Method 2
Use Code to Change the Column Headings:
You can use Microsoft Visual Basic for Applications to dynamically change the column headings in the crosstab query. For additional information about how to use code to change column headings, click the article number below
to view the article in the Microsoft Knowledge Base:
155489 ACC: How to Use Code to Change Column Headings in Crosstab Query
STATUSThis behavior is by design.REFERENCESFor additional information about crosstab queries, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
104758 ACC: Error with Linked Crosstab Subform or Subreport
109939 ACC: Creating a Crosstab Query with Multiple Value Fields
For more information about parameter queries, type parameter queries in the Office Assistant, click Search, and then click to view
Troubleshoot parameter queries.
Modification Type: | Major | Last Reviewed: | 11/28/2003 |
---|
Keywords: | kberrmsg kbprb KB91710 |
---|
|