Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Nov 2002
    Location
    Farnborough, Hampshire, England
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

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

    Does the thread starting at <post:=471,222>post 471,222</post:> help?

  3. #3
    Lounger
    Join Date
    Nov 2002
    Location
    Farnborough, Hampshire, England
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

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

    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!

  5. #5
    Lounger
    Join Date
    Nov 2002
    Location
    Farnborough, Hampshire, England
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    Yes, that did the trick.

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

    Many thanks!

Posting Permissions

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