Show subform total on main form

G

Guest

I have a sub form with the fields Qtt and UCost.
On this form footer I have a calculated field: TotalCost=sum(Qtt*UCost)
On the main form I have a calculated field: ICost=TotalCost

The field on the main form is not working. It shows “?name†error.

Any suggestions?
 
K

kingston via AccessMonster.com

Change the Control Source for the field in the main form to something like:

=DSum("[Qtt]*[UCost]",[SubForm].Form.RecordSource)

I'm assuming you don't want this in the subform (i.e. you don't need to have
the calculated field in the subform).
 
A

Al Campagna

The OP wrote...
On this form footer I have a calculated field: TotalCost=sum(Qtt*UCost)
So... the ICost field on the main simply has to call that existing subform value.
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

kingston via AccessMonster.com said:
Change the Control Source for the field in the main form to something like:

=DSum("[Qtt]*[UCost]",[SubForm].Form.RecordSource)

I'm assuming you don't want this in the subform (i.e. you don't need to have
the calculated field in the subform).

Raul said:
I have a sub form with the fields Qtt and UCost.
On this form footer I have a calculated field: TotalCost=sum(Qtt*UCost)
On the main form I have a calculated field: ICost=TotalCost

The field on the main form is not working. It shows "?name" error.

Any suggestions?
 
G

Guest

Thank you both for your reply.
I could not use Dsum because I need the filed to be immediately updated.
At the end Al Campagna approached worked. A had tried it before with no
success. Maybe it was a syntax problem.


"Al Campagna" escreveu:
 

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

Similar Threads

=Sum([Cost]) gives #Error 7
Sum 3
Total Detail on Continuous Form 2
Total items 3
Subform Subtotal 1
Calculation from a subform 6
Sum in Main Form from Subform 7
Show calculation from main form in sub form 2

Top