Question:
How to put Acrobat PDF button on MS ACCESS 2007 report in order to save the report in PDF format?
greatroni
2009-10-09 13:31:18 UTC
When I run report in MS ACCESS 2007 I want to put a (some command) button on right top corner of report so that user can click, open and save report in PDF format.
Thanks for help in anticipation.
Four answers:
anonymous
2009-10-11 00:52:17 UTC
If you have MS Access 2k7 updated to Service Pack 2, then you should have the save as PDF Add-in already. Otherwise you can download just the Add-in from:



http://www.microsoft.com/downloads/details.aspx?FamilyID=f1fc413c-6d89-4f15-991b-63b07ba5f2e5&displaylang=en



To save your report as a PDF open the report in design view. Select or create your button. Right click on it and go to properties, select the event tab. In the on click event, click the "..." Select "Code Builder". Enter the following:



Private Sub YourButtonName_Click()

On Error GoTo Err_YourButtonName_Click



DoCmd.OutputTo acReport, "YourReportName", acFormatPDF



Exit_YourButtonName_Click:

Exit Sub



Err_YourButtonName_Click:

MsgBox Err.Description

Resume Exit_YourButtonName_Click



End Sub



Replacing YourButtonName with the name of your button and;

YourReportName with the name of your report.



In the properties of the report itself on the format tab, you will also want to change the "Default View" to "Report View". And on the properties for the button, on the format tab, change "Display When" to "Screen Only" so that the button images do not get saved to the PDF.



There are other things you can do such as specify the name and location of the PDF file, but i suspect that this will get you started.



Hope this helps!
anonymous
2009-10-09 14:03:16 UTC
I believe in order to save to a PDF you would need to define a PDF printer. You might look into building something with a subset of ghostscript.



Kind of a pain in the butt if you have to redistribute the program.



If local to your machine only, look at DOCUDESK, they have a decent little PDF printing utility, just print through normal ACCESS report output and print to DESKPDF
anonymous
2009-10-12 19:08:49 UTC
Hey,i would like to share a easier way with you.you can use simpo pdf creator which can convert all MS Office document into pdf format.it's really nice.have a try! http://www.simpopdf.com
Carmella
2016-04-06 04:11:43 UTC
For the best answers, search on this site https://shorturl.im/awLgY



I think that would cut down on reporting quite a bit.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...