ACC2000: Cannot Calculate an Expression Inside an Aggregate Function on a Form or Report in an Access ProjectID: Q225992
|
In a Microsoft Access project, if you place a calculation inside an aggregate (totals) function, you may see one of the following problems:
-or-
The expression 'The expression 'expression' is invalid. @Aggregate functions are only allowed on output fields of the Record Source. @1@.
1' is invalid.
Aggregate functions are only allowed on output fields of the Record Source.
This problem may occur when you set the ControlSource property of a text box on a form or a report to a calculated value inside an aggregate function. For example:
=Sum([Quantity]*[UnitPrice])
Create a field in the record source of the form or the report based on the expression, and then use the aggregate function on that field in the form or the report. For example, create a new field named TotalPrice in the Order Details Extended view. The expression to calculate TotalPrice is:
[Order Details].[Quantity]*[Order Details].[UnitPrice]Then add a text box to the form's footer, and set the ControlSource property to =Sum([TotalPrice]).
Aggregate functions include Avg, Count, Max, Min, and Sum.
Additional query words: prb
Keywords : kbdta AccessCS
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: July 8, 1999