• Show Report Header and Footer for Empty Subreport (Access 97)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Show Report Header and Footer for Empty Subreport (Access 97)

    Author
    Topic
    #455266

    Hi!

    By default, access hides the report header and footer for subreports that have no data. Do you know of any way of forcing it to show them always?

    Thanks!

    Viewing 0 reply threads
    Author
    Replies
    • #1132517

      Does the thread starting at post 471,222 help?

      • #1132705

        Thanks, Hans, but that’s not really what I’m after.

        I would like to force the subreports to appear on the main report, even if they have no data (i.e. the report header and footer to show, although presumably not the detail section since this would be empty). If you open a data-less report directly, you do get headers and footers, but if you open the same report as a subreport, you see nothing.

        One way I could achieve this is to move the headers and footers to the main report, leaving only the detail section in the subreport. The reason I’m reluctant to do this is that it would make it harder to get the controls to align nicely whenever I make changes to the subreport.

        Any other ideas, anyone? If not, I’ll use Plan B.

        Regards,

        Mark

        • #1132723

          The only wat to always display the subreport’s report header and/or footer would be to ensure that there is always at least one record in the subreport, with blank values if necessary. You can do this as follows:

          – If the record source of the subreport is a table, create a query based on this table; if the record source is a query, edit this query.
          – Add the table (or query) behind the main report to the new query.
          – Join the main report table/query to the original ones by the field/fields on which the subreport is linked to the main report.
          – Double click the join line(s) and change the join to a left join that returns all records from the table/query behind the main report.
          – Replace the link field(s) in the query with the corresponding one(s) from the table/query behind the main report.
          – Close and save the query.
          – Open the subreport in design view.
          – Set the new query as its record source.
          – Save and close the subreport.
          – Open the main report in design view.
          – Click once on the subreport.
          – Set the Link Child Fields property to the same as the Link Master Fields property (this is possible because we have added those fields to the record source of the subreport.
          – Save and close the main report.

          This takes less time to do than to write it down!

          • #1132732

            Yes, that did the trick.

            And you’re right, it is easier done than said!

            Many thanks!

    Viewing 0 reply threads
    Reply To: Show Report Header and Footer for Empty Subreport (Access 97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: