Results 1 to 4 of 4
  1. #1
    jcright is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Feb 2022
    Posts
    21

    Subreport blank, calculating and page breaks


    Hello all,

    I have two issues that I need to solve through.

    1. I have a report that uses 3 subreports. Each subreport has a total in its report footer. I have a textbox in my main report that adds up all of the totals from each subreport and it appears to display correctly when I select print preview. This only works if all of the subreports aren't blank (I have verified this to be true). 2 of the subreports should always have something in it. The 3rd subreport may or may not have a total because there may or may not be any activity that month for a particular person that the report is being conjured up for.

    My equation in the text box for the mainreport is: =[subreport1].[Report].[subTotal1]+[subreport2].[Report].[subTotal2]+[subreport3].[Report].[subTotal3]

    I've tried wrapping the subreport total in Nz, but that didn't work. this gives me #Type! error
    I've tried the equation above using Nz([subreport3].[Report].[subTotal3]). that throws #Size! error
    I've tried, in the subreport, to use a query with an expression for either IsNull or IsEmpty and when I view it shows nothing...which I though it was supposed to say true or false?

    2. Once I get #1 working, my next problem involves that same subreport. Right now my main report is setup so that each subreport is on its own page by using page breaks. If my third report is blank, then I don't want it to show and I don't want it to use the page break control. So it should either show me 3 pages if all subreports have something in it, or only two pages if the one report has nothing in it.

  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,538
    Have you tried NZ() within report3 on the textbox that creates the total. Guessing but something like: =NZ(sum(FieldName),0)
    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
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    jcright is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Feb 2022
    Posts
    21
    I tried that and it didn't work. I even tried =(sum(NZ(FieldName),0)).

    I gave up and took another route which is probably harder but it works and for now that is all I need. I can revisit this some other time. What I did is to write some vba code on load to test if any one of the three totals had an error so that I was only adding up the totals that existed. Lots of if/then elseif's.

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

Similar Threads

  1. Page Breaks
    By keiath in forum Reports
    Replies: 6
    Last Post: 01-22-2014, 05:38 PM
  2. Replies: 1
    Last Post: 04-15-2013, 10:02 AM
  3. Page Breaks
    By Talayoe in forum Reports
    Replies: 2
    Last Post: 11-26-2012, 11:20 AM
  4. Page breaks
    By berni3883 in forum Reports
    Replies: 0
    Last Post: 03-31-2011, 01:25 PM
  5. Page Breaks. Is there a way to do it?
    By newtoAccess in forum Reports
    Replies: 8
    Last Post: 11-30-2010, 01:02 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