Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a Total Field in a Form that contains a Subform

Status
Not open for further replies.

mvillara

Programmer
May 18, 2002
24
ES
Well, I have two forms called: "Products List" and "Offers". They are related to each other by the field IDOffer. So, the "Offers" form have "Products List" as a subform. This means that for each offer I create, I have many Products that are selected in the subform placed in the main form: "Offers". Well, now I want to put a field in the main form that calculate the sum of all the products chosen in the subform. It has been imposible for me to get this by now.

Could someone HELP me giving me an advise?

Thanks in advance.
 
Hi

On the sub form (offers) in the footer section, create a text box control (txtTotal), with control source =Sum(MyfieldValue), set its visible property to false

On the main form, create a text box control, set its control source = [SubFormControl].Form!txtTotal
Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
 
Hi

In the footer of the sub form create a control (textbox), set its visible poperty to false, and its control source to =Sum(MyField).

On the main form create a text box control. Set its control source to = Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
 
Ken Reay, thanks for your answer.

I have done it as you expline in your answer but the result is: "#Name?"

In the "Offers" form I show many Products form "Products List", so, How the program know how many records from "products List" should sum?


 
KenReay, ok..... ALl is OK!!!!!!

PERFECT!!!! I made a mistake but now all is all right.

Many thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top