ACC: "#Name?" or Control Is Blank on Form Based on a Query

Last reviewed: May 7, 1997
Article ID: Q92683

The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1, 2.0, 7.0, 97

SYMPTOMS

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

If you have a form based on a query, and the query contains multiple fields with the same name (such as FieldA from Table1 and FieldA from Table2), the control(s) on the form that are bound to that field name will be blank or may display the "#Name?" error.

CAUSE

Because the same field name appears multiple times in the query that the form is based on, Microsoft Access does not know which field to link to the control(s). Therefore, instead of making an assumption about which field to bind to, it leaves the control(s) linked to duplicate field names blank or displays the "#Name?" error in the control.

RESOLUTION

To correct this behavior, rename the field in the query.

To change a field name in a query, follow these steps:

  1. In a query's Design view, place the insertion point in front of the first letter of the field name in the query design grid.

  2. Type the new name followed by a colon. Delete any names assigned by Microsoft Access, but do not delete the field name or expression.

NOTE: Changing a field name in a query's Design view changes the heading in the query's Datasheet view and the field name in a form or report based on the query. However, the underlying field name in the table does not change.

REFERENCES

For more information about changing a field name in a query, search the Help Index for "query design grid," or ask the Microsoft Access 97 Office Assistant.


Additional query words: poundname kbtshoot
Keywords : kberrmsg kbusage QryOthr
Version : 1.0 1.1 2.0 7.0 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: May 7, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.