Solved

MS Access 2010 - Print report without print preview and show printer dialog

Posted on 2013-01-15
3
3,643 Views
Last Modified: 2013-12-17
I want a button in a form to print a report without showing the print preview of the report, but with showing the printer dialog so the user can select a printer or cancel the print job if he changes his mind. How might I do this?

Thanks
0
Comment
Question by:Jolio81
  • 2
3 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 400 total points
Comment Utility
As far as I know that is not possible in Access.

However, a work-around that gets you halfway there is to immediately open the print dialog upon opening your report in preview mode:

DoCmd.OpenReport "rptYourReportName", acViewPreview
DoCmd.RunCommand acCmdPrint

Open in new window

0
 
LVL 61

Expert Comment

by:mbizup
Comment Utility
Another option that might work better for you would be to create a custom print dialog form with a combo box to select your report, and textboxes for page ranges number of copies, etc.

You would still have to open your report in print preview to make it the active object for printing, but then you could use code to automatically close it immediately after printing.

The actual printing could be done with the PrintOut command, which gives you a lot of flexibility for copies, ranges, collation, etc.  See this article for details:

http://msdn.microsoft.com/en-us/library/office/ff192667.aspx
0
 
LVL 57

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
<<Another option that might work better for you would be to create a custom print dialog form with a combo box to select your report, and textboxes for page ranges number of copies, etc.>>

That's what On The Fly printing did.  Works well, but is no longer available:

http://www.groupacg.com/acgOTF.htm

 and not for Access 2010.

 Not sure  why they decided not to go with 2010, but I can tell you the code to support what your trying to do is extensive in OTF.  Took them years to develop it.

 That was before there was a printer object though, which is what most of their code deals with.

Jim.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now