Solved Grand Total of a total field from 25 tabbed pages (1 Viewer)

Sam Summers

Registered User.
Local time
Today, 16:21
Joined
Sep 17, 2001
Messages
849
Is this possible?

I have a form with a tabbed form with 25 pages of stock. Each one has a total field in the footer and i want to display the total value of all the stock held in the header of the main form.

At the moment i have tried this but i am just getting an error

=Sum([TotalAerosolsSubform].[Form]![Cost]+[TotalBoltsSubform].[Form]![Cost]+[TotalNutsSubform].[Form]![Cost]+[TotalWashersSubform].[Form]![Cost])
 

cheekybuddha

AWF VIP
Local time
Today, 16:21
Joined
Jul 21, 2014
Messages
824
What happens if you just add them without Sum()?

It might be prudent to handle possible Nulls too

=Nz([TotalAerosolsSubform].[Form]![Cost], 0) + Nz([TotalBoltsSubform].[Form]![Cost], 0) + Nz([TotalNutsSubform].[Form]![Cost], 0) + Nz([TotalWashersSubform].[Form]![Cost], 0)
 

Sam Summers

Registered User.
Local time
Today, 16:21
Joined
Sep 17, 2001
Messages
849
Hmmm, i got a rather bizarre result of £8.91 rather than the real value of over £1000

Thank you for replying. I wonder if it might better referring to each page by its Tab value?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 00:21
Joined
May 7, 2009
Messages
15,037
you can also create a Query (Total query), qryTotalCost.

select Sum([cost]) As TotalCost from yourTable;

on the textbox on mainform, use the Control Source:

=DLookup("[TotalCost]", "qryTotalCost")
 

Sam Summers

Registered User.
Local time
Today, 16:21
Joined
Sep 17, 2001
Messages
849
you can also create a Query (Total query), qryTotalCost.

select Sum([cost]) As TotalCost from yourTable;

on the textbox on mainform, use the Control Source:

=DLookup("[TotalCost]", "qryTotalCost")
Thanks Arnel i will play about and see how it goes
 

Sam Summers

Registered User.
Local time
Today, 16:21
Joined
Sep 17, 2001
Messages
849
I've got it!
It was an error on my references.

=Nz([TotalAerosolsSubform].[Form]![AeroValue],0)+Nz([TotalBoltsSubform].[Form]![BoltValue],0)+Nz([TotalNutsSubform].[Form]![NutValue],0)+Nz([TotalWashersSubform].[Form]![WasherValue],0)

Thank you all for your help once again
 

cheekybuddha

AWF VIP
Local time
Today, 16:21
Joined
Jul 21, 2014
Messages
824
I've got it!
It was an error on my references.

=Nz([TotalAerosolsSubform].[Form]![AeroValue],0)+Nz([TotalBoltsSubform].[Form]![BoltValue],0)+Nz([TotalNutsSubform].[Form]![NutValue],0)+Nz([TotalWashersSubform].[Form]![WasherValue],0)

Thank you all for your help once again
(y)
 

Users who are viewing this thread

Top Bottom