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



The information in this article applies to:

  • Microsoft Access 2000

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).


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.

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;
				

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.

Modification Type:MinorLast Reviewed:7/15/2004
Keywords:kbprb KB285946