Sintax to SUM SubForm values in MainForm

A

an

Hello!

I have a MainForm with SubForm.

In SubForm I have numerics fields: A and B, and one
Textbox"C", where C=A-B.
I would like, in TextBox in MainForm, to sum all values of
TextBox"C", where the Id's is exactly in the MainForm and
the SubForm, but I don't know the sintax.

Thanks in advance.
an
 
L

Lynn Trapp

Put a textbox in the Footer of your subform (View > Headers and Footers).
Give it the name txtSumC The control source should be set to = Sum(A-B).
Then put a textbox on your main form and make it's control source to be =
Forms!YourForm.Form!YourSubform!txtSumC
 
A

an

Thanks for your reply.

I tried your solution but I obtained next result in
Textbox in MainForm:
#Name?
In adition, I would like to sum ALL VALUES where Id is
equal in MainForm and SubForm.

Thanks.
an
 
L

Lynn Trapp

That indicates, most likely, that you have some spelling error in the
control source of the textbox on your main form.
 

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