Detecting if a previewed report was printed

N

Neil

Hello All,

I have a report wich may get previewed. I have some code in the reports
close event to update some records. I only want the values to be updated if
the report was actually printed out to a printer (and not just closed). Is
there any way to detect this?

TIA,

Neil.
 
B

Brendan Reynolds

Not really, no. Even if you could detect when the report was sent to the
printer, there are still all kinds of things that can prevent the report
from being printed, or prevent it from being printed correctly - the printer
may be low on toner/ink, or the report may have printed on the wrong paper.
These things can prevent the report from printing successfully without
generating any kind of trappable error.

What you can do is to ask the user ...

If MsgBox("Did the report print successfully?", vbYesNo Or vbQuestion) =
vbYes Then ...

I remember someone, I can't remember for sure now who it was, posting that
he generated a random number, printed it in the report footer, and then had
the user enter the number, to confirm that the report had printed. I've
never needed that, but it is a further safe-guard if you need to be *really*
sure.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
N

Neil

Thanks Brendan,

The message box idea will work so i think thats the way to go. Cheers for
the confirmation.

Neil.
 
N

Neil

Thanks Brendan,

The message box idea will work so i think thats the way to go. Cheers for
the confirmation.

Neil.
 

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