Microsoft KB Archive/95442

= ACC: Valid Sum Function Returns #Name? in Calculated Control =

Article ID: 95442

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 Q95442



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



SYMPTOMS
If you open a form in Form view and have two or more calculated controls, you may receive a &quot;#Name?&quot; error in all of the calculated controls on the form, even if the expression for an individual control is valid.



CAUSE
All of the domain functions are based on the same query (over the underlying dynaset). If one of the bound functions on the form has a binding error, all of the functions on the form will return an error.



RESOLUTION
Find the control or controls that use an invalid expression. Either remove the control or correct the expression that you use for the controls.



MORE INFORMATION
You can use aggregate (totals) functions to calculate results only for fields, not for controls. Examples of aggregate functions are Sum, Avg, and Count.

Steps to Reproduce Behavior
 Create a new form based on the Orders table from the sample database Northwind.mdb (or NWIND.MDB in 1.x and 2.0).  Add a text box to the form bound to the Freight field of this table. Set the following properties:

     Text Box --     ControlName: Freight ControlSource: Freight

  Add an unbound text box to the form. Set the following properties:

     Text Box -     ControlName: Test1 ControlSource: =Sum([Freight])

  Add another text box to the form. Set the following properties:

<pre class="fixed_text">     Text Box ControlName: Test2. ControlSource: =Sum([Test1])

</li> View the form in Form view. Note that #Name? appears in the second and third text boxes (Test1 and Test2). Because you cannot use the Sum function on a calculated expression, Test2 is invalid. This causes all calculated expressions on the form to return &quot;#Name?.&quot;</li></ol>

If you remove Test2 from the form, Test1 will display the correct value.

Additional query words: poundname

Keywords: kberrmsg kbprb kbusage KB95442

-

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

© Microsoft Corporation. All rights reserved.