Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: Field Called "Name" in Label Report Displays #Error


View products that this article applies to.

This article was previously published under Q285946
Novice: Requires knowledge of the user interface on single-user computers.


This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).


↑ Back to the top


Symptoms

In Access 97, a field called Name in a wizard-generated label report (with a control source of "=Trim(Report!Name)") print previews without any problems. However, when you convert the same database to Access 2000, the Name field in the label report displays #Error in print preview. In Access 2000, using a full report reference such as "=Trim(Reports![labels customers]!Name)" still displays #Error in print preview.

↑ Back to the top


Resolution

To resolve this problem and keep the same field name:
  1. Create a query that is based on the table (for an .mdb). For an .adp, create a view that is based on the table.
  2. Create an alias for the Name field.
  3. To re-use the previously created report, open the label report in Design view. On the report's Data tab, change the record source to the query that you created in step 1, and then change the ControlSource property of the text box so that it refers to the alias instead of to the field name.
  4. To use a new report, run the Label Report Wizard and base the new report on the query that you created in step 1.
For this .mdb example, create a query that is based on the Customers table. Create an alias (FullName) for the Name field. The following is the query syntax:
SELECT Customers.Name AS Fullname
FROM Customers;
				

↑ Back to the top


More information

Steps to Reproduce the Behavior

  1. Import the Customers table from the Northwind sample database into a new Access 97 database.
  2. In table Design view, change the name of the ContactName field to Name, and then save the table.
  3. Using the Label Report Wizard, create a label report that is based on the Customers table from step 1. Select Name as one of the fields in the label report.
  4. In Design view of the label report, note that the control source for the Name text box is "=Trim(Report!Name)".
  5. Print preview the label report. Note that the label report is displayed with no problems.
  6. Close the database, and then quit Access 97.
  7. Convert the Access 97 database to Access 2000. Open the Access 2000 database.
  8. Print preview the label report. Note that the Name text box displays #Error.
  9. Change the Name text box reference to a full report reference such as "=Trim(Reports![labels customers]!Name)." Note that the full report reference, in print preview, also displays #Error.

↑ Back to the top


Keywords: KB285946, kbprb

↑ Back to the top

Article Info
Article ID : 285946
Revision : 2
Created on : 7/15/2004
Published on : 7/15/2004
Exists online : False
Views : 243