Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2003
    Posts
    3

    Question Unanswered: report section/header format

    I am trying to have the page header for a report appear on pages that a particular group heading does not and not appear on pages that have the group heading. Any ideas as to how to code this?

  2. #2
    Join Date
    Oct 2003
    Location
    Tampa
    Posts
    10
    You can refer to the sections of reports in the modules....
    and their properties.
    i.e.

    Code:
    Private Sub Report_Open(Cancel As Integer)
    With Me
        If MyReport = "New Report Style" Then
              .PageFooterSection.Visible = True
              .PageHeaderSection.Visible = False
        Else: MyReport = "Old Report Style"
              .PageFooterSection.Visible = False
              .PageHeaderSection.Visible = True
        End If
    End With
    End Sub
    You can use any conditions you want---you could even use a table to actually track the options and just use variables, that way you wouldn't have to change the code--just the option in the table.

    Hope this helps...

  3. #3
    Join Date
    Oct 2003
    Posts
    3

    Report conditional formatting

    Thanks for the idea, I'm not sure that I understand what you mean by tracking the options. What I need is to be able to evaluate each page individually within the report. I think the Report_open event only happens once. What I have is a report that will produce a large number of form letters, the first page of each has a letterhead banner. I have a page header which is serves as a one inch margin on following pages (it does not appear on the first page with the report header. It works great until the second letter which needs the letterhead banner to be at the top again without the margin. I have been stuck with either the letterhead being placed too low on following letters or with letters that have second pages with the text too high. I could write a module to run through the recordset and print each letter as a separate report but it seems that there must be a way to evaluate each individual page on a report for content to determine whether the pageheader should be visible or not. Maybe not. Any ideas? Thanks.

  4. #4
    Join Date
    Oct 2003
    Location
    Tampa
    Posts
    10

    Re: Report conditional formatting

    If you only need the Banner on the first page of your group of pages in a letter....put the banner within the group-section of the report design.

    but the code I gave you above could work as well.....
    just use it under the Page Event (Report_Page)

    "The Page event occurs after Microsoft Access formats a page of a report for printing, but before the page is printed. You can use this event to draw a border around the page, or add other graphic elements to the page."

    If you are printing directly from a table, and not a query, then you will need more code in the event to find out "where" you are in the report, as each page is ready to print...if you use a query that has group-sections and you are forcing a new page--put the function within section event in module.

    Originally posted by Scott Zalaznik
    Thanks for the idea, I'm not sure that I understand what you mean by tracking the options. What I need is to be able to evaluate each page individually within the report. I think the Report_open event only happens once. What I have is a report that will produce a large number of form letters, the first page of each has a letterhead banner. I have a page header which is serves as a one inch margin on following pages (it does not appear on the first page with the report header. It works great until the second letter which needs the letterhead banner to be at the top again without the margin. I have been stuck with either the letterhead being placed too low on following letters or with letters that have second pages with the text too high. I could write a module to run through the recordset and print each letter as a separate report but it seems that there must be a way to evaluate each individual page on a report for content to determine whether the pageheader should be visible or not. Maybe not. Any ideas? Thanks.

  5. #5
    Join Date
    Oct 2003
    Posts
    3

    Conditional format report

    I am using a query with group sections and each time a new group (in this case a new letter recipient) is printed I force a new page. Will the Report_Page event go back and reformat the page?
    ie
    If groupheader1 this page (not sure proper code for this)
    then PageHeader.visible = false

    I had been doing trial and error without success but have not used the Report_Page event.

    Is there a way with code to suppress the page header at the point that a new page is forced for each groupheader?

    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
  •