Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4552
  • Last Modified:

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

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
Jolio81
Asked:
Jolio81
  • 2
1 Solution
 
mbizupCommented:
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
 
mbizupCommented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
<<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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now