Results 1 to 7 of 7
  1. #1
    Jblackbelt is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    20

    Display No Data in the report if the report has no data

    hi all,



    i have a report that consists of 7 subreports. If the subreports have no data, the subreports do not show up when printing or in orint preview. Is there a way that if there is no data, I can have it display text in the report such as "No Reviews to Complete as of mm/dd/yyyy?

    thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Example from my db:

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me.lblOU.Visible = Not Me.ctrOU.Report.HasData
    Me.lblCO.Visible = Not Me.ctrCO.Report.HasData
    Me.lblRC.Visible = Not Me.ctrRC.Report.HasData
    End Sub
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Jblackbelt is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    20
    Thanks. that did not end up working for me.

    I should also note that individually each report will print out with no data. it is only as subreports that the reports disappear with no data.

    In the event there is no data, i would like it to display "No Reviews Due as of MM/DD/YYYY" under each subreport header.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    AFAIK, can't do that. Subreport has no data it won't show which means labels and unbound textboxes on the subreport won't show either. Only way I could get a message was to put label on main report and code behind the main report.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Jblackbelt is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    20
    Could I embed it in the original report (before I embed it as a sub report)? If so, how would I go about it?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    A subreport IS embedding on main report. Otherwise, I really don't know what you are asking for.

    How many tables are involved in the main and sub form RecordSources? Post the SQL statements.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Jblackbelt is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    20
    I did it a little unconventially. I have a blank report that has one hidden date field. I then drag in 7 reports as "subreports." Essentially there is no "main report" as it is a shell for the 7 subreports to be displayed as one. I'm having trouble getting the SQL statement out of it. They come from 1 table, but several queries.

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

Similar Threads

  1. Replies: 4
    Last Post: 04-09-2015, 08:59 AM
  2. Replies: 4
    Last Post: 06-02-2014, 10:07 AM
  3. Replies: 3
    Last Post: 02-17-2013, 09:20 PM
  4. Replies: 5
    Last Post: 03-25-2012, 12:31 PM
  5. Replies: 6
    Last Post: 02-20-2009, 11:50 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