Add total to form from subform

  • Thread starter Thread starter Sandy
  • Start date Start date
S

Sandy

I have a form and subform based on 'qryContact_Details' (form) and
'qryJob_Details' (subform).

I have a calculated field within the 'qryJob_Details' namely 'Total'. On my
subform the control for this field is 'txtTotal.

What I am trying to do is add a text box to my main form that sums the
'Total' field in the subform.

Any ideas?
Sandy
 
Sandy,
This was very helpful to me. I think ist is what you want to do. And thank
Steve Schapel, Microsoft Access MVP for this. He helped me out.

In the Footer section of the subform, put an unbound textbox, and in the
Control Source enter like this:
=Sum([Invoice Amount])
Let's say you name this textbox TotalAmount.

If you need this total amount to be shown on the main form, rather than
the subform, then you can set its Visible property to No in the subform,
and then on the main form, use a textbox with this Control Source:
=[Invoice Tracker subform1]![TotalAmount]
 
Use the Dsum function in the control source, you can sum up whatever value
you want from whatever table(s) you want without having to have them as the
recordsource of that form.
 
Thank you Ayo, it is exactly what I want.
Sandy

Ayo said:
Sandy,
This was very helpful to me. I think ist is what you want to do. And thank
Steve Schapel, Microsoft Access MVP for this. He helped me out.

In the Footer section of the subform, put an unbound textbox, and in the
Control Source enter like this:
=Sum([Invoice Amount])
Let's say you name this textbox TotalAmount.

If you need this total amount to be shown on the main form, rather than
the subform, then you can set its Visible property to No in the subform,
and then on the main form, use a textbox with this Control Source:
=[Invoice Tracker subform1]![TotalAmount]

--
Steve Schapel, Microsoft Access MVP



Sandy said:
I have a form and subform based on 'qryContact_Details' (form) and
'qryJob_Details' (subform).

I have a calculated field within the 'qryJob_Details' namely 'Total'. On
my
subform the control for this field is 'txtTotal.

What I am trying to do is add a text box to my main form that sums the
'Total' field in the subform.

Any ideas?
Sandy
 
Thank you Lance,

I have never used Dsum but I will research it and give it a go.

Sandy
 
if you need help just pass along the table information, field names and
formula.. I'm always more than happy to help.
 
Back
Top