Calculate totals in form from subquery

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

Guest

We have a form with a subquery.
The subquery filters details after entering the beginningDate and endingDate in the form's controls (using 'between' in criteria field of DateID).
We would like to calculate totals of linetotal field of the subquery.
The totals text box which is to be calculated is in the main form.
 
JB,
Do you mean you have a "subform" on a main form that shows records that
lie within the date range on the Main form?
If so, in the subform footer, a calculated field (call it ex.
[SumLineTotals]) with...
=Sum([LineTotal])
should yield the total of those selected/filtered records.
If you still need a field on the Main form to show total, create an
unbound text control with...
=Forms!frmMyMain!frmMySubForm.Form![SumLineTotals]
and it will always display the same total as the subform field.
--
HTH...
Al Campagna
Candia Computer Consulting
Candia, NH

JB said:
We have a form with a subquery.
The subquery filters details after entering the beginningDate and
endingDate in the form's controls (using 'between' in criteria field of
DateID).
 
Back
Top