Getting sums from continuous forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a subform thats source is from a table. I have the view in continuous
forms because each record is a request for an item to be purchased. The
fields are:

LineNumber StockNumber Item Quantity Price Total (Unbound Calculation)

I would like to be able to total all the Totals to get a subtotal. This is
not a query so I don't know if it is even possible. Any ideas?
 
Sean,
Bring your table into a query behind the subform. Create a calculated
field in that query called LineTotal (your Total)
LineTotal : Price * Quantity
Now, LineTotal is a "bound" field.
Place that field on your form, and it can be added in the footer by...
=Sum(LineTotal)
 
Add a Calculated Control in the (Sub)Form Footer using the ControlSource:

= Sum([Quantity] * [Price])
 
Your use of Total and Subtotal was confusing to me.

You said you wish to total all the totals to get a subtotal.

Try to describe your form/subform arrangement more clearly. Are you
saying that your subforms have a calculated field named Total which
is Price * Quantity?

The view is set to continuous forms, so the subform is repeated for
each master record of the parent form?

So this ... let's call it grand total ... should be where? In the footer of
the parent form? If so, it could be done a couple of ways, but the best
solution may depend on how your parent/child recordsets are designed
between the form and subform.

The Parent form could have a text box control with this control source:

=DSum("[Quantity] * [Price]","qrySubformRecordset")

I tested this and it worked. I also was reminded that you can't have a
subform inside a form with continuous form view, so now I'm really
confused about what your arrangement is.
 
Back
Top