running total

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
 
K

Klatuu

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top