Results 1 to 4 of 4
  1. #1
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875

    Report Referencing Field in a Subreport with No Data

    Namely, how do I handle this?

    I have a report that calculates square footage of waste at our plant. It has a Subreport in it that displays the waste by type (how much of item A did we throw away, how much of item B, etc.).

    Below the Subreport is a section where several totals are calculated:

    • Total square footage processed during the day
    • The total square footage wasted during the day
    • The percentage of square footage wasted during the day

    The problem is, that if we miraculously had a day with no waste, all the fields except the first one display #Error.



    How can I check to see if the Subreport has data and, if it does, use 0 instead of trying to use the sum of all the waste displayed in the Subreport?

    I've attached two images, one where everything works (the Subreport has data) and one that doesn't (the Subreport is empty).

    Note: The Subreport looks at a different Table/Query than the main 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
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    Dear Mr. Pbaldy,

    I want to bear your children.

    Thanks,

    Rawb

    P.S.
    OK, so not really, but I am very grateful!

  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
    LOL! I should warn you, my wife is not much into sharing.
    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. SubReport Problem.
    By gianfrancom in forum Reports
    Replies: 3
    Last Post: 04-26-2010, 02:43 PM
  2. Report and Subreport
    By newbie in forum Reports
    Replies: 0
    Last Post: 02-16-2010, 12:14 PM
  3. Subreport Calculation field
    By Cheshire101 in forum Reports
    Replies: 2
    Last Post: 01-14-2010, 05:50 PM
  4. Referencing table data in field validation rule
    By toad848 in forum Database Design
    Replies: 3
    Last Post: 03-19-2009, 07:03 AM
  5. Replies: 0
    Last Post: 01-28-2009, 03:47 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