Error setting Paperbin

C

Colin Small

In my client's Access 2003, ADP application, I want to print reports on
different papercolors depending on a couple of criteria, and accordingly we
have set up a laser with 4 paper drawers.

During the Report_ open event, I check the the availables bins using
DeviceCapabilities (essentially KB Q194789) and try to set
me.printer.paperbin to the appropriate value. This works fine as long as
the values is <= 256, but if it is greater, then I get a "runtime error 5,
Invalid procedure or argument". These values are valid and commonly used -
see below.

If I use the menu/page setup to set the report to a specified printer,
select one of the paperbins and paperbin, then paperbin is successfully set
to the higher values, but these still cannot be re-written.

In the immediate window:
?report_rptcustomer.Application.Printer.PaperBin
257
report_rptcustomer.Printer.PaperBin = 1 to 256 succeeds
report_rptcustomer.Printer.PaperBin = 257 fails

As a temporary workaround, I can set up a report for each configuration and
for each color with a selected print setup. However setting .paperbin
should work and when the project expands to multiple printers, it becomes a
nightmare. There is probably some historic limit check, but does anyone
one have a proper workaround.

Colin

-----------------------------------------
From enumerating DeviceCapabilities


\\mc1\Epson Stylus COLOR 1520 ESC/P
15 Automatically Select
7 Auto sheet feeder
4 Manual Feed Slot
513 Manual Feed (Banner)
8 Tractor Feeder

\\mc1\Fax
1 Default

\\mc1\Lexmark Optra E312
1 Tray 1
4 Manual Feed
6 Man. Envelope
7 Auto Select

\\mc1\Lexmark Optra E312 PS2
15 Auto Select
256 Tray 1
257 Manual Paper

\\mc1\Lexmark T630
1 Tray 1
2 Tray 2
3 Tray 3
257 Tray 4
14 MP Feeder
4 Manual Feed
6 Man. Envelope
7 Auto Select

\\mc1\Lexmark T630 PS3
15 Auto Select
256 Tray 1
257 Tray 2
258 Tray 3
259 Tray 4
260 Tray 5
261 MP Feeder
262 Envelope Feeder
263 Manual Paper
264 Manual Envelope

Microsoft Office Document Image Writer
1 Default tray

EPSON Stylus C82 Series
7 Sheet Feeder

Adobe PDF
15 Automatically Select
257 OnlyOne

ActiveTouch Document Loader
15 Automatically Select
8 Tractor Feed
4 Manual Paper Feed
258 Sheet Feeder - Bin 1
257 Sheet Feeder - Bin 2
 
S

SA

Colin:

As you've found the printer object of a report doesn't support specific
paper bin values greater than 256 (which is the value above which printer
manufacturers are supposed to use a value to represent one of the
non-standard bins.) To work around this you need to use the prtDevMode
property which is a bit more complex to use and will NOT work by calling it
in the on open event.

Stop by our web and look in the code and design tips area under reports for
a tip called: "How to Assure Proper Page Orientation and/or Paper Size for A
Report Run On Different Machines". This will also allow you to specify a
Tray with a value greater than 256.

HTH
 
C

Colin Small

Steve,

Thanks for the fast response. Unfortunately we planned to use the runtime
only license, which won't allow the form to be opened acDesign! Is
prtDevMode writeable at any other times?

Colin
 
S

SA

Colin:

So long as you are not distributing an MDE, the run time WILL allow you to
go into design mode, the user simply won't see it. If you are using an mde
file, then you'd have to open the report in print preview first and address
the prtdevmode.
 
C

Colin Small

Steve,

We are actually distributing an ADP project. I went ahead and used Preview
mode. When the report opens I use an openargs flag in the setup openreport
to trigger an empty of the recordsource during report_open, so the
connection isnt made and this part happens qucikly. Seems to work OK now.
Thanks for the help. Maybe paperbin will get fixed in the new service pack!

Thanks for the help.

Colin
 
C

carias4244

Colin Small:
I stumbled across your posting, and have a similar situation: I woul
like to have the users the ability to choose a printer, tray an
orientation for predefined reports.

I will be reading the value of the tray from a dropdown form. But i
the value is > 256 I get the error mentioned by you. And another this
is that Even though I force to save the report, the changes do no
stick. THe work aroud so far is to present a msgbox and hav ethe use
select File -> Save once the report is formatted for the new printer..
Here is what I have

X = CInt(Me.cmbLabelPrinterTray.Value)
Y = Me.cmbLabelPrinter
DoCmd.OpenReport "rpt_Labels", acViewPreview
Reports("rpt_Labels").Printer = Application.Printers(Y)

With Reports("rpt_Labels").Printer
.PaperBin = 15
If Me.cmbLabelPrinterOrientation = True Then
.Orientation = acPRORLandscape
Else
.Orientation = acPRORPortrait
End If

End With
MsgBox "Select File -> Save"
DoCmd.Close acReport, "rpt_labels", acSavePrompt


Please let me know how to work around it.

Regards,
Cesar

-Originally posted by Colin Small -
In my client's Access 2003, ADP application, I want to print report
on
different papercolors depending on a couple of criteria, an
accordingly we
have set up a laser with 4 paper drawers


-
carias424
 

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