Subtotal for Calculated Field (1 Viewer)

David Ball

Registered User.
Local time
Tomorrow, 04:54
Joined
Aug 9, 2010
Messages
230
Hi,

I have attached a database. There is a form displayed when the database is opened. If you select a date (say 21-Jul-2017) you will see that the Subtotal for Project for JC + DC Hours (Text53) is not summing the values for each Project correctly.
For each Project the Disciplines are displayed with the number of SI Hours, JC Hours and DC Hours. I have a calculated field that adds JC Hours to DC Hours and shows the sum for each Discipline (if there are both JC Hours and DC Hours). This is textbox Text33.
This works well but I want to also show a total of the JC + DC Hours for each project, and this is the part I can’t get to work.
Please note that I can’t just add the JC hours in the Subtotal for Project section to the DC Hours in this section as this gives an incorrect total in many cases (where some Disciplines have only JC Hours or DC Hours, but not both).
What formula do I need to put into Text53 to show the correct result?
Thanks very much
Dave
 

Attachments

  • ProjectHours.accdb
    1.8 MB · Views: 59

isladogs

MVP / VIP
Local time
Today, 20:24
Joined
Jan 14, 2017
Messages
18,209
Hi

Not sure why you started a new thread as I gave you almost exactly what you needed in an earlier thread - see https://www.access-programmers.co.uk/forums/showpost.php?p=1540189&postcount=5

All you need to do is use this in both total textboxes:
Code:
=Nz(Sum([DC Hours]),0)+Nz(Sum([JC Hours]),0)

I've also added the same value in the Grand Total row in the report footer and as far as I can see it all works perfectly

 

Attachments

  • Capture.PNG
    Capture.PNG
    20.1 KB · Views: 106
  • ProjectHours - CR.accdb
    1.8 MB · Views: 59

David Ball

Registered User.
Local time
Tomorrow, 04:54
Joined
Aug 9, 2010
Messages
230
Ah both! I did try it (in the bottom box only) and it didn't work.

I will give it a try in both.

I started a new thread because I wanted to attach the database and couldn't for the life of me find how to attach it to a reply.

Thanks very much
 

isladogs

MVP / VIP
Local time
Today, 20:24
Joined
Jan 14, 2017
Messages
18,209
I started a new thread because I wanted to attach the database and couldn't for the life of me find how to attach it to a reply.

Use the advanced editor when replying and you will get the full toolbar & be able to add attachments

I've already updated your report in the new copy of your db that I uploaded
 

Users who are viewing this thread

Top Bottom