Printing Reports

S

stetat

I have a form that opens a series of reports in preview.
I would like to add an entry to an event table only if the
user prints the report not if it is closed.
Does anyone know if there is an event that the report
raises when the user prints.

Any help would be appreciated.
 
A

Allen Browne

There is no event to distinguish print from preview.

If the user prints the report without previewing, you can know because the
report's Activate event does not fire. However, if they preview and print
from the preview, that doesn't help.

An underlying issue is why you need to know. If it's important to track what
was printed when, then in my view it's worth recording that into a table.
The table would have fields for:
- Batch number (unique identifier for this print run);
- PrintDate (date and time of the print run);
- ID (foreign key identifying the p.k. of all records included in the
report).
This structure allows the user to recall and reprint any batch at any time.
Because there are so many things that can go wrong with a physical process
like printing (paper jams, network issues, out of ink, ...), I think that
provides useful functionality.

And it's probably a bit better than asking "Did you print this?"
 
J

Jake

Allen,

Could you elaborate on this part?
- ID (foreign key identifying the p.k. of all records included in the
report).

Is this to mean another table could keep track of each
record each time it is printed? Would this require these
two tables (I believe the first is what you described)?

tblReportPrint
RepPrintID (PK)
RepName (String)
RepDate (Date/Time)
UserID (Long)

tblRecPrint
RecPrintID(PK)
RepPrintID
RecordTableName (String)
RecordNumber (Long)

Then query back through the two to get the actual records
printed?

Thanks!
Jake
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top