Calculate totals in form from subquery

J

JB

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.
 
A

Al Camp

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).
 

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