Okay, so the Print event of a Detail occurs *before* printing; but I need
to
know that printing has already occurred. I can find no event that fires
or
property that's flagged *after* the user has sent a report to the
printer.
Apparently even PrintCount is useless in this regard.
Anyone have any suggestions?
TIA,
Randall Arnold
Little late to the party, but I read the rest of the thread. I'm
posting this on the top level, because my suggestion doesn't involve
the activate event.
What we do with one of our reports is to the use the Report Close
event and ask the user if it successfully printed. Granted, using a
scenario such as this, you are relying on the user to truthfully
answer the question, so it's not good for a extremely serious security
model.
In our case, we set a flag when the ReportFooter is printed, then
check for the presence of the flag in the closing of the report and
act accordingly.
In this scenario, we flag the associated records with the print date,
as well as the trackingID which is assigned to the printout.
Our report will continue to include those records who have not been
printed until it finally gets a successful printing.
This could easily be adapted to store usernames, or to have a master
table which saves the report name + report time printed, or any number
of other things.
Again though, it's relying on the user to successfully and truthfully
answer the question.
** Code **
Private Sub ReportFooter_Print(Cancel As Integer, PrintCount As
Integer)
fWasPrinted = True
End Sub
Private Sub Report_Close()
Dim src As String
Dim intResponse As Integer
Dim lngLastTrackingID As Integer
If fWasPrinted Then
intResponse = MsgBox("Did the audit report print out ok?",
vbQuestion + vbYesNo, _
"Print out ok?")
If intResponse = vbYes Then
lngLastTrackingID = ELookup("[VoidEditTrackingID]", "[System]") + 1
src = "UPDATE Audit SET Audit.PrintedOn = Now(), Audit.TrackingID =
" & lngLastTrackingID & " WHERE (Audit.PrintedOn Is Null);"
DoCmd.SetWarnings False
DoCmd.RunSQL (src)
src = "UPDATE System SET System.VoidEditTrackingID = " &
lngLastTrackingID
DoCmd.RunSQL (src)
DoCmd.SetWarnings True
End If
End If
End Sub
** End Code **
-D
---------------------
Duncan Bachen (dbachen@NOSPAM_olehansen.com)
Director of IT
Ole Hansen and Sons Inc.
---------------------