Add total to form from subform

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
 
A

Ayo

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]
 
L

Lance

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

Sandy

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
 
S

Sandy

Thank you Lance,

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

Sandy
 
L

Lance

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

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