Microsoft KB Archive/285946

= ACC2000: Field Called &quot;Name&quot; in Label Report Displays #Error =

Article ID: 285946

Article Last Modified on 7/15/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



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 &quot;=Trim(Report!Name)&quot;) 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 &quot;=Trim(Reports![labels customers]!Name)&quot; 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;



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 &quot;=Trim(Report!Name)&quot;.
 * 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 &quot;=Trim(Reports![labels customers]!Name).&quot; Note that the full report reference, in print preview, also displays #Error.

Additional query words: prb #error print preview controlsource name convert pounderror

Keywords: kbprb KB285946

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.