Counting # of pages printed from a report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kazoo
    New Member
    • Mar 2008
    • 9

    Counting # of pages printed from a report

    I'm trying to capture the # of pages printed from a report to use on another report.

    There are several records that are not standard size, therefore I can't just count the records and deduce how many pages printed.

    Anyone have any ideas?
  • lee123
    Contributor
    • Feb 2007
    • 556

    #2
    you mean like on the page footer if so enter this

    Code:
    ="Page " & [Page] & " of " & [Pages]
    i think this will help.

    lee123

    Comment

    • Kazoo
      New Member
      • Mar 2008
      • 9

      #3
      Originally posted by lee123
      you mean like on the page footer if so enter this

      Code:
      ="Page " & [Page] & " of " & [Pages]
      i think this will help.

      lee123
      Thanks for your suggestion, but no, not on the page footer and actually not even on the same report. I want to post the total pages on a different report.

      Comment

      • Scott Price
        Recognized Expert Top Contributor
        • Jul 2007
        • 1384

        #4
        You'll need to place a hidden text box on the report with its control source set to
        Code:
        =Pages
        Then create a Public variable in a standard code module, not in the report's code module, call it intTotalpages or whatever you like. Next you can populate this variable in the OnPage event of your report. Since it's declared as Public, it will be available until you close the database or change it.

        If you need it to be available beyond a close/reopen, you'll need to write it to a table set to hold just this data.

        Regards,
        Scott

        Comment

        • Kazoo
          New Member
          • Mar 2008
          • 9

          #5
          Originally posted by Scott Price
          You'll need to place a hidden text box on the report with its control source set to
          Code:
          =Pages
          Then create a Public variable in a standard code module, not in the report's code module, call it intTotalpages or whatever you like. Next you can populate this variable in the OnPage event of your report. Since it's declared as Public, it will be available until you close the database or change it.

          If you need it to be available beyond a close/reopen, you'll need to write it to a table set to hold just this data.

          Regards,
          Scott
          Thank Scott. That sounds like it will work perfectly.

          Comment

          • Scott Price
            Recognized Expert Top Contributor
            • Jul 2007
            • 1384

            #6
            Glad to be of a help! Let me know if there's anything more that you need to get this working.

            You might need to declare this variable as a Static variable instead of just a Public. The Static has a greater scope, meaning it lasts longer than the Public. However, not even a Static will hold it's value through a close/reopen of the database.

            Regards,
            Scott

            Comment

            Working...