Microsoft KB Archive/155667

= ACC: Cannot Set ColumnHeadings Property of Crosstab Using Code =

Article ID: 155667

Article Last Modified on 11/17/2000

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition

-



This article was previously published under Q155667



Moderate: Requires basic macro, coding, and interoperability skills.



SYMPTOMS
The online Help topic for the ColumnHeadings property reads as follows:

Version 7.0
  You can set this property using the query property sheet or Visual Basic.

Version 2.0
  You can set this property using the query property sheet, a query's SQL view, or Access Basic. The documentation is incorrect. The ColumnHeadings property cannot be set using Visual Basic for Applications (or Access Basic in version 2.0).



MORE INFORMATION
The ColumnHeadings property is not an exposed property of the QueryDef object. It can be created and then appended to the QueryDef's properties collection, but it will have no effect on the actual column headings for the crosstab query.

You can change the column headings in a crosstab query by using one of the following methods:
 * Set the ColumnHeadings property on the query's property sheet.
 * Modify the PIVOT clause in the SQL view of the query.
 * Modify the PIVOT clause of the QueryDef object's SQL property using Visual Basic for Applications.

To see an example of how to programmatically change the column headings of a crosstab query, please see the following article in the Microsoft Knowledge Base:

155489 ACC: Changing Column Headings in a Crosstab Query Using Code

