Solved

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

Posted on 2013-01-15
3
3,766 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
subtract 1 in Access 2003 query 7 39
Sub Reports 8 23
count all and uniques records in a table 20 27
Search Form not Querying 2 11
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…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

895 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

18 Experts available now in Live!

Get 1:1 Help Now