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!

Calculating Totals outside of a subform

Status
Not open for further replies.

only412c

MIS
Jan 29, 2003
32
US
I have a two subforms within a form and am trying to calculate the a fields for each record in the two subform respectively. I want the totals of these fields to be displayed outside the subforms. For the first subform, I have the following [PaymentAmounts subform].Form![TotalsAB].
For the second subform, I have the following [Settlement subform].Form![TotalExp]as the control source of the control. However, only the amount for the selected record in the subform appears in the total field. How can I have all records appearing in the subform to calculate and shown in the totalAB and TotalExp, respectively.
 
your subforms are linked to main form by the link field
the control source of the totals textboxs should be
dsum("fieldname","tablename","childlinkfield="& me.masterfield)
put this in the on current of the of the main form
totaltextbox=dsum("fieldname","tablename","childlinkfield="& me.masterfield)
and in the after update of the subforms
me.parent.totaltextbox=dsum("fieldname","tablename","childlinkfield="& me.masterfield)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top