Solved

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

Posted on 2013-01-15
3
3,923 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
ID: 38781137
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
ID: 38781168
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
ID: 38782594
<<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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

808 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