Report Page Numbering problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Reedsp
    New Member
    • Apr 2007
    • 19

    Report Page Numbering problem

    I have a report that displays the page numbering incorrectly. Example page 1 of 3 but only 2 pages are displayed when previewing or printing the report. Here is the details:

    Page footer - text box with control source as:
    ="Page" & [Page] & " of " & [Pages]
    There is a group header with the following code in the OnFormat property: linecnt = 0
    Group Footer OnFormat property:
    Code:
        If linecnt = 1 Then
            DoCmd.CancelEvent
        End If
    Not sure if this code helps. Any thoughts would be helpful on why the page counter says 3 pages instead of 2?
    Thanks!
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Originally posted by Reedsp
    I have a report that displays the page numbering incorrectly. Example page 1 of 3 but only 2 pages are displayed when previewing or printing the report. Here is the details:

    Page footer - text box with control source as:
    ="Page" & [Page] & " of " & [Pages]
    There is a group header with the following code in the OnFormat property: linecnt = 0
    Group Footer OnFormat property:
    If linecnt = 1 Then
    DoCmd.CancelEve nt
    End If

    Not sure if this code helps. Any thoughts would be helpful on why the page counter says 3 pages instead of 2?
    Thanks!
    1. What exactly is linecnt, and how is it incremented?
    2. As a Temporary Band Aid, can you use:
      Code:
       ="Page" & [Page] & " of " & [Pages] - 1
    3. Have you tried setting Cancel = True in the Group Footer's Format() Event as oppossed to DoCmd.CancelEve nt, namely?
      Code:
      If linecnt = 1 Then
        Cancel = True
      End If
    4. What exactly are you trying to Cancel?

    Comment

    • Reedsp
      New Member
      • Apr 2007
      • 19

      #3
      Thanks for the suggestions. I tried both. The -1 suggestion worked for reports with 3 pages and only showing 2 but not when there is 174 page report. The Cancel Event didn't do anything different.

      I will try and explain what is happening, I didn't program the report, I inherited the Database and so I'm trying to solve the problems.
      In the Group Header 0 Format property the code reads: linecnt = 0
      In the Detail Print Format property the code reads: linecnt=linecnt +1
      In the Group Footer0 Format property the code reads: If linecnt=1 then
      docmd.Canceleve nt
      End if
      Description of what it is doing as best as I can: As each new group is printed the linecnt is set to zero, so that in the footer the text boxes show( these are total boxes summing values from the detail line. The report only wants to print or show the "Total" boxes when there is a new group. When access goes to preview or print the report the page counter is correct for the number of pages but because of the format property not to show the footer after every detail line only at group breaks the report appears or shows less pages. Hope this makes sence. I think the Detail Print linecnt=linecnt +1 line helps to the system not to print the group footer info by incrementing the counter until a new group appears.

      Not sure where to go from here because the page counter function is correct in the number of pages but the view is limited by the group footer format code. Any suggestions or thoughts on how to not show information in the footer but have the pages function reflect what actually is in preview.

      Thanks.

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        Originally posted by Reedsp
        Thanks for the suggestions. I tried both. The -1 suggestion worked for reports with 3 pages and only showing 2 but not when there is 174 page report. The Cancel Event didn't do anything different.

        I will try and explain what is happening, I didn't program the report, I inherited the Database and so I'm trying to solve the problems.
        In the Group Header 0 Format property the code reads: linecnt = 0
        In the Detail Print Format property the code reads: linecnt=linecnt +1
        In the Group Footer0 Format property the code reads: If linecnt=1 then
        docmd.Canceleve nt
        End if
        Description of what it is doing as best as I can: As each new group is printed the linecnt is set to zero, so that in the footer the text boxes show( these are total boxes summing values from the detail line. The report only wants to print or show the "Total" boxes when there is a new group. When access goes to preview or print the report the page counter is correct for the number of pages but because of the format property not to show the footer after every detail line only at group breaks the report appears or shows less pages. Hope this makes sence. I think the Detail Print linecnt=linecnt +1 line helps to the system not to print the group footer info by incrementing the counter until a new group appears.

        Not sure where to go from here because the page counter function is correct in the number of pages but the view is limited by the group footer format code. Any suggestions or thoughts on how to not show information in the footer but have the pages function reflect what actually is in preview.

        Thanks.
        Can you send me a Copy of the Database if I give you my E-Mail Address in a Private Message?

        Comment

        • Reedsp
          New Member
          • Apr 2007
          • 19

          #5
          I wish I could but its 55 MB and contains financial information. The only alternative is to copy the report to a database of its own. You can't run the report but you could look at the structure and code. If this would help let me know.

          Comment

          • ADezii
            Recognized Expert Expert
            • Apr 2006
            • 8834

            #6
            Originally posted by Reedsp
            I wish I could but its 55 MB and contains financial information. The only alternative is to copy the report to a database of its own. You can't run the report but you could look at the structure and code. If this would help let me know.
            I looked over the Report for a brief period of time, but without some visual indication of what is happening (via valid Report data), I'm afraid that an accurate Reply isn't forthcoming. Duplicating the functionality would be much too time consuming. You also have 2 Groupings based on the same Field but with Headers/Footers flipped, and different Group Intervals. This may be a source for confusion. Can you provide me with some valid data, so that I may see exactly what is/is not happening in the Report?

            Comment

            • Reedsp
              New Member
              • Apr 2007
              • 19

              #7
              I will see what I can do to get some data. It may take me a few days.

              Comment

              • ADezii
                Recognized Expert Expert
                • Apr 2006
                • 8834

                #8
                Originally posted by Reedsp
                I will see what I can do to get some data. It may take me a few days.
                No rush, Reedsp, I'll be away from April 20 to April 22 anyway.

                Comment

                Working...