Results 1 to 11 of 11
  1. #1
    Koloss is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2013
    Posts
    14

    Grand total from two sub-reports

    Hello everyone,



    I'm stuck....
    I have a report, which consists of two subreports.
    I have total sums on each report.
    I’m trying to get a Grand total from those two totals at the end of the main report.
    Whatever I try, I get an error.....
    The last thing I tried was :

    Code:
    =[mySubReportName].[Report]![myTextControlName]+[mySubReportName1].[Report]![myTextControlName1]
    Any idea, advice, guidance ?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Not sure if this would work on a report but on a form I think you would have two (hidden) text boxes. Each one would reference the total on the sub.

    So something like:
    =[mySubReportName].[Report]![myTextControlName]

    and

    =[mySubReportName1].[Report]![myTextControlName1]

    Then your Grand total text box would reference these two.

    =FirstBox + SeondBox
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    Koloss is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2013
    Posts
    14
    I try that and got #Name?
    I belive i wrong reference a textbox... But i am noy sure...

  4. #4
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,557
    Hi

    Can you upload a zipped copy of the Db?

  5. #5
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,557
    Or try this :-

    =[Reports]![NameofMainReport]![NameofSubReport].[Report]![NameofTextbox1] to obtain the first Total *******(Edited to include the SubReportName]

    Then use the same naming convention to obtain the Second Textbox
    Last edited by mike60smart; 06-28-2020 at 08:47 AM. Reason: Edited to show the name of SubReport

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  7. #7
    Koloss is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2013
    Posts
    14
    DB was to big and complex for uploading.... Have several parts and i use it in company for furniture design and manufacturing

  8. #8
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Quote Originally Posted by Koloss View Post
    DB was to big and complex for uploading.... Have several parts and i use it in company for furniture design and manufacturing
    Did you read the link i gave you in post#6
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  9. #9
    Koloss is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2013
    Posts
    14
    Yes. I just read it. I will tryt on that way. Thanks !

  10. #10
    ijaz8883 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    103
    Quote Originally Posted by Koloss View Post
    Hello everyone,

    I'm stuck....
    I have a report, which consists of two subreports.
    I have total sums on each report.
    I’m trying to get a Grand total from those two totals at the end of the main report.
    Whatever I try, I get an error.....
    The last thing I tried was :

    Code:
    =[mySubReportName].[Report]![myTextControlName]+[mySubReportName1].[Report]![myTextControlName1]
    Any idea, advice, guidance ?
    Sorry to Seniors of this group in Advance:

    I have tried to solve this and my formula is working perfect

    First of All Create a New Report (Main_Report)
    Now put your 2 sub reports up and down (Subreport1) & (Subreport2)
    The Total of Subreports row name may be (Totalsub1) (Totalsub2)
    Now just create a Row for subtotal in this main report (Total_of_Two_Subreports)
    Now put the code in the (Total_of_Two_Subreports) where you want to get the total:

    =[Subreport1]![Totalsub1]+[Subreport2]![Totalsub2]

    You have no need to mention (Main_Report) in report calculation row.


    See in Picture How I do this (Sorry for my rough work).
    Click image for larger version. 

Name:	total of subreports.jpg 
Views:	13 
Size:	130.8 KB 
ID:	42323

    and its Done
    If you found any problem plz comments

  11. #11
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,557
    Hi

    You need to create your References as follows:-

    1. To get the Total from SubReport1 use the following in an Unbound Textbox and name the Textox "Total1":-

    =[Reports]![NameofMainReport]![NameofSubReport1].[Report]![NameOfTotalonSubReport1]

    2. To get the Total from SubReport2 use the following in an Unbound Textbox and Name the Textbox "Total2":-

    =[Reports]![NameofMainReport]![NameofSubReport2].[Report]![NameOfTotalonSubReport2]

    3. Now Add the 2 Unbound Textbox Values using the following in an Unbound textbox:-

    =Nz([Total1],0)+Nz([Total2],0)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Grand total on grouped report?
    By dmon2010 in forum Reports
    Replies: 1
    Last Post: 02-26-2015, 02:02 PM
  2. How to Calculate this Grand Total
    By TWD in forum Reports
    Replies: 2
    Last Post: 01-13-2012, 11:36 AM
  3. Grand Total Field ???
    By damo1995 in forum Forms
    Replies: 6
    Last Post: 02-10-2011, 02:43 PM
  4. Grand total of field on a subreport
    By degras in forum Reports
    Replies: 9
    Last Post: 02-03-2011, 12:09 PM
  5. :?: newbie...grand total?
    By PnerraD in forum Access
    Replies: 1
    Last Post: 08-24-2006, 06:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums