Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004

    Unanswered: always show subreport problem

    I created a report consisting of different subreports. The problem is that not always all data of all subreports are filled in.
    Access automatically skips the whole subreport if for that report no data is available. That is not exactly what I want. I would like at least that the title of the subreport is shown or even better (if it is possible) that in that case also 1 empty data-row is shown.
    Anybody an idea?
    Tnx for helping me!

  2. #2
    Join Date
    Jul 2003
    One way you could do it is by placing a label on the top of the subreport - non visible. Put text like "No data available" or something like that. Then - when you format the report - check if the subreport has any data, and show the new label if not. i.e:

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
      If srptWhatever.Report.HasData = False Then
        lblNoData.Visible = True
      End If
    End Sub
    (this code is in the main report)

    Make sure your subreport has CanGrow and CanShrink set to True (so it can disappear if required).

    There's probably easier / better ways (if there is, let me know) - but that's how I've done it in the past. If required you can have more labels showing up - i.e. headings as well as a message etc.
    Last edited by joeldixon66; 05-13-04 at 06:42. Reason: typo
    Joel Dixon
    Analyst Programmer
    Melbourne, Australia

  3. #3
    Join Date
    Apr 2004


    Sorry, but It seems that it doesnt work...It won't show a report anymore when I do this. Maybe I did something wrong with the names...

    If my report is called "report_sheet"
    and my subreport is called "subreport_personal_data"

    How does the code looks like in that way?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts