Results 1 to 2 of 2
  1. #1
    tylerg11 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    200

    #Error when report has no data

    Hello,



    I have a function on my main report that totals multiple different textbox values. This works great with the exception that one of these text boxes exists on the subreport. As long as the subreport contains data this is not an issue. However, when the subreport doesn't return records, the final total shows up as #Error.

    I read online that I can use the HasData function to detect for records and return a 0 if non are returned. I am still getting an error.

    Code:
    =IIF([SubReportName].Report.HasData=True, [SubReportName].Report![SubReportFieldName, 0)

  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
    You're missing a closing bracket there. I use this:

    http://access.mvps.org/access/forms/frm0022.htm
    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. No Data on report error
    By tweety in forum Reports
    Replies: 8
    Last Post: 04-09-2013, 01:21 PM
  2. Data mismatch error in Access report
    By ragpatil in forum Reports
    Replies: 9
    Last Post: 09-10-2012, 07:54 AM
  3. Replies: 3
    Last Post: 08-15-2012, 10:00 AM
  4. Replies: 7
    Last Post: 06-08-2012, 09:55 PM
  5. Replies: 1
    Last Post: 05-11-2012, 10:59 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