An Access Form:How to get PDF of a access form
I have a Icon of PDF in my form that i have created in Access 2010. There are 3 tabs in that form; each tab have a separate form page and PDF icon is common for all the tabs.
Now I want that whenever a user click on that icon a PDF file of that form get created.
I have written this code:
Private Sub cmdPrintReportPDF_Click()
If Form_Graphs.tab_graph.Value = 2 Then
DoCmd.OpenReport "Graph_report2", acViewNormal
DoCmd.OutputTo acOutputReport, "Graph_report2"
DoCmd.Close acReport, "Graph_report2"
Else
DoCmd.OpenReport "Graph_report", acViewNormal
DoCmd.OutputTo acOutputReport, "Graph_report"
DoCmd.Close acReport, "Graph_report"
End If
End Sub
开发者_如何学JAVA
Now I wanted that whenever a user click PDF icon of the form it display the report in the PDF form.I don't want to save the report into PDF file ,just want that user can see it in PDF mode.
How can I do that?
Try the Open method of Application.Documents, e.g. Application.Documents.Open "C:\mydoc.pdf".
精彩评论