Solved

How print report to pdf and have it open right away on screen

Posted on 2014-04-11
3
431 Views
Last Modified: 2014-04-12
I'm having a problem with image resolutions (another topic) and want to try a work-around.

Is the a way via VBA to from a command button on a form, print a report to a pdf and then have that pdf report appear on the screen right away?

--Steve
0
Comment
Question by:SteveL13
3 Comments
 
LVL 13

Expert Comment

by:akb
ID: 39995272
I'm not sure about using VBA however there is another way to do it. Install PDFCreator from SourceForge. It is open source and free. Set PDFCreator as default printer. Print a document and select Options. Go to Auto-save and tick Auto-save and "After auto-saving open the document...".
0
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 39995305
place this codes in the click event of a button

private sub button_click()

DoCmd.OutputTo acOutputReport, "rptTable2", acFormatPDF, CurrentProject.Path & "\myReport.pdf"

FollowHyperlink CurrentProject.Path & "\myReport.pdf"


end sub
0
 

Author Closing Comment

by:SteveL13
ID: 39996094
This worked perfectly.  The only thing is it seems to open the pdf at 105%.  I wish it was about 75%.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

707 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

17 Experts available now in Live!

Get 1:1 Help Now