View Single Post
  #1  
Old July 25th, 2007, 04:55 PM posted to microsoft.public.access.reports
davea
external usenet poster
 
Posts: 18
Default Capturing when a report is printed

I'm trying to record the date and time when a particular report is
actually printed. I have seen methods on the groups for recording when
a report is previewed e.g. using activate and deactivate events on the
report. I currently have a table that records a date and time for the
report but it also records it when you preview and close the report
without printing. Here's the code I'm using:

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

How do you capture when a report has been printed? Any suggestions
welcome.