Link to home
Start Free TrialLog in
Avatar of ommer
ommer

asked on

Trap PrintOut Action was Canceled

Hi, experts,

I have a three parts question that I want to achieve programatically in access 97 VBA.
How to fire a Cancel action on a DoCmd.PrintOut? That is equivelant of clicking the Cancel button on the Print dialog box.
How to trap "The Print Out Action was canceled" ?
How to bypass/suppress the OK button on above message box?

I have a batch printing proccess running un-attended on the server room. Some times, a print command runs into long splooling mode. I want to kill that job, log the result and move on to next record without human intervention.

Thanks!
Avatar of jefftwilley
jefftwilley
Flag of United States of America image

ok, I want to try to help you...but I need to know stuff.

Your batch process first.

What is it...and how do you start it, and how does it queue. If it's code based, how do you know the job has ran too long? IS there a way to monitor that so that after a threshold time...intervention can occur.

The rest we'll deal with as we go...but that is needed to get us going.
Avatar of ommer
ommer

ASKER

I got a dataset with RecordID as the Key for the where clause to my report. Looping through the recordset, the code supplied the where clause and docmd printout to either a printer or a fax driver, based on another criteria (field name Send_Method) in the data set.
Occationally, one of the print out got into spooling mode and stuck there for a long time. I understand the ultimate solution is to solve the issue.
But as an alternative get around for the time being, I am thinking to add a timer in the loop.  When, say, 5 minutes elapes, cancel the current one, record the result in the table and move on.
Or at least get a solution for my 2nd and/or 3rd questions, then when operator cancel the stuck print job, the program will handle the rest nicely.
I know I may be asking too much.
ASKER CERTIFIED SOLUTION
Avatar of jefftwilley
jefftwilley
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial