Results 1 to 6 of 6
  1. #1
    gemadan96 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Oct 2012
    Posts
    110

    Hide Rows in a subreport

    I have a report called Account with two subreports, Charges and Payments.

    There are some records in Charges that have a 0 value because they've been waived. The record needs to be in the table, but doesn't need to be included in the subreport. I would like to hide the rows where the charge is 0. One way to accomplish this is in the query have it only retrieves the records where the charge is >0. If the account has all 0 values for the charges then no records appear. The problem is that I want to sum the charges and compare them with the payments to determine the balance. When there are no charges in the Charges subreport the balance control displays as #Type!

    So I would like to either hide the rows that have a charge of 0 or if there are no charges then the Sum of the Charges should = 0.

    Any suggestions on how I can do this?



    I have used conditional formatting to change the color of the 0 value to white, but I would rather just not see the row in the report.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    This should work for option 2:

    nnz function

    You could use code in the detail format event to hide lines, but my first inclination is the above.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    gemadan96 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Oct 2012
    Posts
    110
    An update: In the report I've built an expression for a control to calculate the balance using the following -

    =Nz([Charges subreport].[Report]![TotalCharges])-Nz([Payments subreport].[Report]![TotalPayments])

    This works in Report view but not in Print Preview. In print preview or when I print the control prints as #Size!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You didn't want to try the function I suggested?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    gemadan96 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Oct 2012
    Posts
    110
    I think I was typing my update as your reply came in.

    I tried NNZ and it works perfectly.

    Thanks.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 2
    Last Post: 04-02-2014, 09:15 AM
  2. Hide Empty SubReport
    By mystifier in forum Reports
    Replies: 0
    Last Post: 06-08-2012, 01:10 AM
  3. Hide Subreport if specific fields are empty
    By hawkins in forum Reports
    Replies: 1
    Last Post: 03-29-2012, 05:08 PM
  4. Hide SubReport
    By TinaCa in forum Programming
    Replies: 6
    Last Post: 09-15-2011, 08:03 PM
  5. Show Hide Subreport / acViewReport
    By BigBear in forum Reports
    Replies: 4
    Last Post: 03-30-2009, 06:07 AM

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