Pausing and restarting printer

  • Thread starter Thread starter Xavier
  • Start date Start date
X

Xavier

Is there any way to pause and restart the printer from
within access.

My issue is an old lable printer (serial) that if I send
more than 2 lables at a time it gets a buffer overflow
and it is a very expensive printer to dump and replace
due to the type of lables we use but if I could send lets
say 10 lables to print and have it pause and wait for
someone to click OK to print the next 2 that would work
for me.

Thanks
Xavier
 
Xavier:

There's really no good way to manage a print buffer that way from within
Access. Your best bet is to use a filter on your label report that would
return only ten records at a time.

One way you could do this add an auto number field to your query, where each
row contains a incremental counter. To see how to do this stop by our web
and in the Code and Design tips area, look in the queries section for the
tip on adding an autonumber.

Then in code, open the report's underlying recordset and get a record count.
If say you've got 35 total labels, then you've got four batches to do. You
can then filter the report to print based on the RowID you've created WHERE
ROWID Between 1 and 10, 11-20 etc. with a message box in the loop to have
the user click for the next batch to be sent once the first batch clears.

If you really wanted to get complex you could replace the manual
intervention (with the message box) with an api call to enumprintjobs to
check the print spooler's buffer for that printer. Pausing your code in each
loop until the buffer is cleared. The only caveat here is that even though
Windows spool buffer is cleared, doesn't necessarily mean the printer's
memory buffer is depleted (it could be still printing) unless the printer
supports ECP or EPP commands that feed back status to Windows.

HTH
 
Back
Top