Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculate sum from subform

Status
Not open for further replies.

snuffi01

Technical User
May 24, 2003
26
SE
I have an form with an subform with data in it.
I would like to have an field in my main form witch calculates the summary from an field in the subform.
I have tried this: =nz([KundkontaktTabellUnderformular].[Formulär]![Summa]).
But i just get the data from the first entry i the subform, and i want it to calculate the summary of all entries in the subform.
 
You first need to create an unboud field on your sub form that sums all of the information that you need. This is typically placed in the footer of the sub form. Then you can create another field on your main form and reference the subform control.
 
Use DSUM("FieldName","TableName",criteria) using the same fields and tables as the subform with the proper criterion. Place this in the on_current event and it works like a charm.


rollie@bwsys.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top