Microsoft KB Archive/198924

= ACC2000: Field Name in Query Results Doesn't Match QBE Alias =

Article ID: 198924

Article Last Modified on 6/28/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q198924



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

This article applies only to a Microsoft Access database (.mdb).



SYMPTOMS
When you rename a field in a query by using a field alias in the QBE grid, the field name that you see in Datasheet view is different from the alias you used in the QBE grid.



CAUSE
This behavior occurs when the Caption property of the field in the query's source table contains a value.



RESOLUTION
To have Microsoft Access display the correct name for the field in the query results, remove the Caption property value that you have set for that field in the table. Then, the new name that you give the field will be displayed in the query.



Steps to Reproduce Behavior

 * 1) Open the sample database Northwind.mdb.
 * 2) Create a new query based on the Customers table.
 * 3) Add the CompanyName field to the Field row.

NOTE: The Caption property of this field is set to "Company Name" (without the quotation marks) in the Customers table.
 * 1) Rename the CompanyName field as "Co Name" (without the quotation marks).

NOTE: To rename a field in a query, place the insertion point in front of the first letter of the field name in the query design grid, and type a new name for the field followed by a colon.
 * 1) Run the query. Note that the new name for the CompanyName field is not displayed.

