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

ID: Q198924


The information in this article applies to:

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.


MORE INFORMATION

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.


  4. 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 (:).


  5. Run the query. Note that the new name for the CompanyName field is not displayed.



REFERENCES

For more information about aliases, click Microsoft Access Help on the Help menu, type "change the field name in a query" in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

Additional query words: prb data source


Keywords          : kbinterop kbdta QryHowto 
Version           : WINDOWS:2000
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: May 13, 1999