Article ID: 154894
Article Last Modified on 1/19/2007
Table: tblPrintedReports
--------------------------------------------------
Field Name: ID
DataType: AutoNumber (or Counter in version 2.0)
Indexed: Yes (No Duplicates)
Field Name: ReportName
DataType: Text
FieldSize: 75
Field Name: PrintDate
DataType: Date/Time
Format: General Date
Table Properties: tblPrintedReports
-----------------------------------
PrimaryKey: ID
Option Explicit
Global Flag
Private Sub Report_Activate()
Flag = 0
End Sub
Private Sub Report_Deactivate()
Flag = -1
End Sub
Sub ReportHeader3_Print (Cancel As Integer, PrintCount As Integer)
Dim dbs As Database, rst As Recordset
Set dbs = CurrentDB()
Set rst = dbs.OpenRecordset("tblPrintedReports")
Flag = Flag + 1
' If the current value of Flag = 1, then a hard copy of the
' report is printing, so add a new record to the history table.
If Flag = 1 Then
rst.AddNew
rst!ReportName = "rptCustomers"
rst!PrintDate = Now
rst.Update
Flag = 0
End If
End Sub
ID ReportName PrintDate
--------------------------------------
1 rptCustomers 8/13/96 3:25:11 PM
Additional query words: evaluate diary
Keywords: kbhowto KB154894