running total

  • Thread starter Thread starter Rpettis31
  • Start date Start date
R

Rpettis31

I have a subform that basically tallies and order
Part - Qty - $ per each - total
I have after update code that will update the total.
I have a text box that is set to sum the total column.

I had code to pass the value of this to the main form yet it the only way it
will work is if the values are rentered or a new record added to the sub form.

Here is my code
' calculate the dollar value of the components
Me.TotalCost = Me.Qty * Me.CostPerEa

With Forms!frmRWForm
!txtMtlsCost = Me.txtSumCost
End With

End Sub
 
There is an example of how this is done in the Northwind database Order and
Order Detail forms for 2003

Basically what you do is put a text box in the subform's form footer section
that sums the values in the subform's rows in the control source property

=Sum(TotalCost)

Then on the main form, you use another text box to display the value of the
text box in the footer of the subform's form:

=SubformControlName.Form.TextBoxName
 
Back
Top