how to sum field entries

bamwamba

Registered User.
Local time
Today, 22:54
Joined
Feb 16, 2007
Messages
10
hi everyone,
i have a registration form which has a subform.one of the fields on a subform captures all sources of income and amounts that a would be member has.i need to sum up all the amounts and display them on the main form as one lump sum.Does anybody have an idea on how best to go about it?
Thank you in advance!
 
Use could try creating a query on the datasource for the subform; use the ID field linking the subform to the parent to identify only the records related to the displayed (i.e: set the criteria of the field to the ID field of the parent form (you can use the Expression Builder to set the criteria for the ID field). Then, in the text box on the parent form, use the DMax function to reference the query and the sum field.

Note: it is considered poor practice to then store this value as the value can be calculated from the other stored data.

Oh, and BTW, this may not be the best method but I think it should work...

Tim
 
Thanks Tim,
Is it possible to use a form in the expression dsum("[expression]","domain","[criteria]") as a domain instead of a table? i want to sum up figures on the field of a form.
 
in the subform footer create a calculated comtrol that sums the field in question

ie =SUM(myfield)
 

Users who are viewing this thread

Back
Top Bottom