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.
- 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:
Text Box
----------------------------
ControlName: Test2.
ControlSource: =Sum([Test1])
- View the form in Form view. Note that #Error? 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 "#Error?."
If you remove Test2 from the form, Test1 will display the correct value.