Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Sydney, New South Wales, Australia
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hiding Report Pages (Access2003 SP2)

    I have a multi-page report to produce an statement of accounts for each company which prints one page per company. It has a subreport to list all the financial activity which or may not have any data. So if there is no financial activity from the subreport, how do I hide/suppress that specific report page? The end result on the entire print run is to see only statement pages with financial activity.

    Thanks

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

    Re: Hiding Report Pages (Access2003 SP2)

    Put code like the following in the On Format event of the section that contains the subreport:

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Cancel = Not Me.FinancialActivities.Report.HasData
    End Sub

    In this example, Detail is the section, and FinancialActivities is the name of the subreport as a control on the main report. This is not necessarily the same as the name of the subreport in the database window. Open the report in design view and click once on the subreport to see its control name in the Formatting toolbar and in the Properties window.

  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Sydney, New South Wales, Australia
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hiding Report Pages (Access2003 SP2)

    I put the code into the OnFormat event of the Detail section on the main report and it didn't make any difference. The report still shows empty statement pages where there are no financial transactions. Am I doing something wrong?

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

    Re: Hiding Report Pages (Access2003 SP2)

    Could you post a stripped down copy of your database? See <post#=401925>post 401925</post#> for instructions.

  5. #5
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Sydney, New South Wales, Australia
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hiding Report Pages (Access2003 SP2)

    Hi Hans

    Sorry for the delay - a few things came up. Here is a stripped down version showing essentials only. As always, thanks for your help.

    In the attached file, the report "rptStatement" will show six (6) pages. It is pages 4 and 5 I want to hide/suppress.

    Kind regards

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

    Re: Hiding Report Pages (Access2003 SP2)

    There is no need to group your report on clName; sorting it is sufficient. If you put the info from the group header and footer into the detail section and remove the group header/footer, the code will work as intended. You must set the Force New Page property of the detail section to 'Before section'.

    (In the attached version, I had to modify the subreport a bit, it produced an error message on my PC)

  7. #7
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Sydney, New South Wales, Australia
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hiding Report Pages (Access2003 SP2)

    Thank you very much Hans - I appreciate your invaluable help.

    I understanding what you've done and the reasons behind it.

    Regards

Posting Permissions

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