ACC: How to Maintain a Print Log for ReportsLast reviewed: April 2, 1997Article ID: Q154894 |
The information in this article applies to:
SUMMARYModerate: Requires basic macro, coding, and interoperability skills. This article describes how to add a record to a table each time you print a report. This technique is useful for maintaining a print log that tracks the print history of a report.
MORE INFORMATIONThe following example uses the Print event of a Microsoft Access report to add a record to a table. The record contains the report's name and print date. The example uses the report's Activate and Deactivate events to set a global variable that is evaluated during the Print event. This prevents Print Preview from adding a new record to the history table. NOTE: In Microsoft Access 7.0 and 97, there is one sequence of events that will create a new record in the history table when you Print Preview the report. If you open the report in Design view to view or change any of its code and then switch to Print Preview, the Activate event does not occur, and the global variable is not set. To work around this problem, after viewing or changing the report's code, close the report before you open it in Print Preview. CAUTION: Following the steps in this example will modify the sample database Northwind.mdb (or NWIND.MDB in version 2.0 or earlier). You may want to back up the Northwind.mdb (or NWIND.MDB) file and perform these steps on a copy of the database.
Creating a History Table and a Report
Generating a History Record
REFERENCESFor more information about Activate and Deactivate events, search the Help Index for "Activate," or ask the Microsoft Access 97 Office Assistant. For more information about Print events, search the Help Index for "Print Event," or ask the Microsoft Access 97 Office Assistant.
|
Additional query words: evaluate diary
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |