OpenReport action cancelled because of Printer

A

AllenB

What is the issue when Access cancels an OpenReport action based on a
particular (default) printer? If the selected printer is changed, such as
default to Adobe Acrobat, reports open properly.

I know I can manually change the printer on my computer but I'm concerned
about proper functioning of a deployed database. Is there a way to manage
this without programmatically changing a user's prnter? Thank you.

AllenB
 
A

Allen Browne

Open the report in design view. Go to Page Setup, and change middle tab so
that it uses the Default Printer (not a Specific Printer.) The report will
then format for whatever printer the user has, as long as they have some
valide printer driver installed.

If you need to programmaticallly change the printer, in Access 2002 and
later you can set the Printer object before you open the report. If you want
to offer the user to have the report remember to go to one of their
printers, see:
Printer Selection Utility - Users assign printers to reports
at:
http://allenbrowne.com/AppPrintMgt.html
 
A

AllenB

Thank you Allen. I tried your solution, found the default printer option
already selected, and had no success in cycling the settings.

I believethe issue is what consititutes a 'valid' printer. For example, my
installation of HP Laserjet 1020 does not allow report previews in MS Access.
If the default printer is Quicken PDF, however, the report previews
properly. Interestingly I , by Quicken's design, cant use that Quicken PDF
printer except from within Quicken. In the Quicken case, the report views
valid but printing isnt valid. In the HP Laserjet 1020 case, I cant preview
reports but I can print them (if an alternate printer is set as the defalt
which allows OpenReport actions).

Are there specific printer settings or characteristics that prevent its
'valid' use in previewing MS Access report? I truly appreciate your help.

AlenB
 
A

Allen Browne

I am not familiar with printer drivers that have the limitations you
describe.
 
K

KitCaz

Allen, thanks for providing the link to your awesome set printer utility!

I had a couple of hurdles:

1) for whatever reason, setting my report toolbars to 'ReportToolbar' caused
an error and I wasn't able to get the menu item onto any toolbar. I worked
around this by just putting a checkbox on my application form that the user
can tick off before they hit 'Preview' which will set the desired prompt.

2) I found that when I allowed frmSetPrinter to open and I didn't change the
printer (I just clicked 'OK' with the 'use default printer' selection, I
received an error in the line of code that tries to delete the "Printer2Use"
property because it doesn't exist. I wrote a condition in the error logic to
skip the error message if the err.number was equal to 3265, so I covered this.

Although I'm pretty much ok, I'm just telling you this In case I did
something wrong in the way I installed this. It's an awesome set of code,
though, so THANK YOU!

Chris
 
B

Bernie

I believe I have the same problem. see 'Reports won't open. Please Help'
31/10/07 in this news group. 'DoCmd.OpenReport ....' fails in code and all
other means of opening a report fails including Design. Since the same
reports have worked with the same printer and setup previously, there must
be a solution. Have you just reinstalled something?
 
A

Allen Browne

Thanks for the feedback.

Re issue 1:
You should be able to import the toolbar from the sample database with:
File | Get External | Import
After selecting the file, click the Options button in the Import dialog.
Then click the Menus And Toolbars box.

Re issue 2:
Thanks: have adjusted the code so it calls HasProperty() before attempting
to delete the property.
 

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