seamus99
asked on
How to Sum a Calculated Field in a Form Footer Access 2007
I have a Form (Datasheet is the default view) that contains a caluated field. (RevisedBill). I want to total all the rows , I created a Text Box in the footer of the form using:
=sum(RevisedBill) I get nothing in the box no, error or anything just a blank field.
Any help?
=sum(RevisedBill) I get nothing in the box no, error or anything just a blank field.
Any help?
seamus99,
You can only apply those aggregate (across-records) functions to fields in the form's field list.
It sounds like you've got a text box that does a calculation in its control source, like =Price - (Price * Nz(Discount)). Access will not let you Sum, Max, Min across those text box controls.
Instead, create a query with all of the underlying table or query's fields and an additional field, RevisedBill: Price - (Price * Nz(Discount)). RevisedBill will then appear on the form's field list. Change the Control Source of the textbox with the calculation to: RevisedBill (no equals sign). Then you can add a control with an aggregate function of this field, like =Sum(RevisedBill) or Max(RevisedBill).
HTH,
pT72
You can only apply those aggregate (across-records) functions to fields in the form's field list.
It sounds like you've got a text box that does a calculation in its control source, like =Price - (Price * Nz(Discount)). Access will not let you Sum, Max, Min across those text box controls.
Instead, create a query with all of the underlying table or query's fields and an additional field, RevisedBill: Price - (Price * Nz(Discount)). RevisedBill will then appear on the form's field list. Change the Control Source of the textbox with the calculation to: RevisedBill (no equals sign). Then you can add a control with an aggregate function of this field, like =Sum(RevisedBill) or Max(RevisedBill).
HTH,
pT72
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
use Continuous Forms as the default view,
use this in the Control Source of the textbox
=sum([RevisedBill])