How to check report print event?

  • Thread starter Thread starter Min
  • Start date Start date
M

Min

Hi, I need to do something after user printed a report. But how can I know
user clicked "Print" and the report is successfully printed? I cannot find
event such as "Printing" or "AfterPrint" to write code.
 
No, there is not "Actually Printed" event.

If the user prints directly (without preview) then the Activate event does
not fire. If they do preview, you may be able to create custom menus and
toolbars that give you a click event to work with.

More significantly, though, there are *many* things that can go wrong with a
print process, e.g. out of paper, network problem, job reset by another
user, printer turned off, ... Perhaps you could just use the Close event of
the report to ask the user whether it actually printed.

A more basic question might be why you need to know this. If it is important
to know which records were printed and when, then it is probably worth
creating a table to record the primary key of the records that printed as
part of each run. Two tables:

tblPrintRun table:
PrintRunID AutoNum primary key
PrintDate Date/Time (when the print run started)
UserID who printed this
ReportID which report was printed
tblPrintRunDetail table:
PrintRunID foreign key to tblPrintRun.PrintRunID.
RecordID foreign key value to whichever primary key is appropriate
to the report.

You assign the values to these table before running the report, and the
RecordSource of the report uses the tblPrintRunDetail to limit it to the
desired records. This approach gives you a complete history of who printed
what when, and allows to user to reprint the run if something went wrong.
 
Thank you for your reply. What I need is to record if a document has been
printed or not. I can create menu or button to find if the user print or not
and then write to record, but I don't have control if user chose preview,
then print. As you said, there is no such event to monitor the print event,
however, do you know if there is any control, beside the standard controls
used by Access, which can monitor the printer?
 
Not that I am aware of.

A custom menu and toolbar would let you run whatever code you needed to.
 
Back
Top