Microsoft KB Archive/90860

= ACC: #Error When Control Name Used in ControlSource Expression =

Article ID: 90860

Article Last Modified on 1/18/2007

-

APPLIES TO


 * Microsoft Access 1.0 Standard Edition
 * Microsoft Access 1.1 Standard Edition
 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q90860



Novice: Requires knowledge of the user interface on single-user computers.



SYMPTOMS
A field returns a &quot;#Error&quot; error message when the ControlSource property (bound field) contains the Name property in an expression. However, in an unbound text box, the same expression generates the expected value rather than &quot;#Error.&quot;

NOTE: The Name property is called the ControlName property in Microsoft Access versions 1.0 and 1.1.



CAUSE
There is a circular dependency in either a form or a report. Control names take precedence over field names when binding. Microsoft Access does not provide a more descriptive error for circular references.



RESOLUTION
If you need to reference the Name property in an expression, use an unbound text box. Otherwise, reconstruct the ControlSource property expression so that it does not reference the Name property.

Another alternative is to change the name on the form.



STATUS
This behavior is by design.



MORE INFORMATION
If you create a form based on a table or query and drag a numeric field onto the form, by default the ControlSource property and the Name property will be given the name of the actual field in the underlying table or query. If you change the ControlSource property to an expression that includes the Name property, you will see &quot;#Error&quot; in this field when you switch to Form or Datasheet view. The following example demonstrates an expression within the ControlSource property:

     Name:            Person_ID ControlSource: =[Person_ID] + 1

Additional query words: pounderror

Keywords: kberrmsg kbprb kbusage KB90860

-

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

© Microsoft Corporation. All rights reserved.