Print Preview Close

R

richard

Hi

I have a report which when closed runs an update query. The user will not be
able to reprint jobs (in bulk) when this query has been run.
So I would like to have a prompt in the report Print Preview on the close
event which asks if the user has printed the jobs with vbYesNO, then if they
click No then they are returned to the print preview and the report does not
close. If they click yes then the query is run.
I am struggling with stopping the report closing when the vbNo is clicked.
Any thoughts or pointers appreciated
 
A

Allen Browne

Report_Close is too late.

Use Report_Unload instead. If you want to cancel the closing of the report,
just add the line:
Cancel = True
to that event.

I fear you will still have problems with knowing whether the report printed
(e.g. if the printer jams and someone resets it before the paper came out),
or worse, if the user reboots your program (via the task manager -
Ctrl+Alt+Del) and so corrupts your database because they can't get out in a
hurry and want to be able to print it later.

For an alternative approach consider:
Has the record been printed?
at:
http://allenbrowne.com/ser-72.html
 
G

gianni

richard said:
Hi

I have a report which when closed runs an update query. The user will not
be
able to reprint jobs (in bulk) when this query has been run.
So I would like to have a prompt in the report Print Preview on the close
event which asks if the user has printed the jobs with vbYesNO, then if
they
click No then they are returned to the print preview and the report does
not
close. If they click yes then the query is run.
I am struggling with stopping the report closing when the vbNo is clicked.
Any thoughts or pointers appreciated
 

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