ACC: Word Merge Field Names Differ from Query Names in MS Access

Last reviewed: June 6, 1997
Article ID: Q167062
The information in this article applies to:
  • Microsoft Access versions 7.0, 97
  • Microsoft Word 97 for Windows
  • Microsoft Word for Windows 95 versions 7.0, 7.0a

SYMPTOMS

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

When you export a query to Microsoft Word that contains field names which have been renamed in the query, the field names that are exported to Microsoft Word are different from the field names that are displayed in the query.

CAUSE

This behavior occurs when the Caption property of the fields in the table contain a value.

RESOLUTION

To have Microsoft Access and Microsoft Word display the same names for the fields, remove the Caption property values that you have set for the fields in the table. Then, the new names you have given the fields will be displayed in both the query and in Microsoft Word.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Open the sample database Northwind.mdb.

  2. Create a new query based on the Customers table.

    NOTE: The Caption property is set to "Company Name" (without the quotation marks) in the Customers table.

  3. Add the CompanyName field to the Field row twice.

  4. Rename the first CompanyName field as "Cust A" and the second CompanyName field as "Cust B" (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. Save and run the query. Note that the new names for the CompanyName fields are not displayed.

  6. Close the query.

  7. In the Database window, select the query, and on the Tools menu, point to Office Links, and then click "Merge It with MS Word" (or "Merge it" in Microsoft Access 7.0).

  8. In the Microsoft Word Mail Merge Wizard box, click "Create a new document and then link the data to it," and then click OK.

  9. When Microsoft Word starts, click the Insert Merge Field button. Note that Microsoft Word shows the new field names even though Microsoft Access does not.

REFERENCES

For more information about renaming fields in queries, search the Microsoft Access Help Index for "renaming fields," and then "change a field name in a table," or ask the Microsoft Access 97 Office Assistant.


Keywords : AutoGnrl kbinterop QryHowto
Version : 7.0 7.0a 97
Platform : WINDOWS
Hardware : x86
Issue type : kbprb
Resolution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 6, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.