By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,940 Members | 611 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,940 IT Pros & Developers. It's quick & easy.

saving report to PDF

P: 12
Hello,
I need to save my access report (named 'reportall) to PDF. Taking reference from a Youtube video, I entered following code(provided below). But when I click on the button, it says Run-time error 2282. The format in which you are attempting to output the current object is not available."
Please help me out
Expand|Select|Wrap|Line Numbers
  1. Private Sub btnpdf_Click()
  2. Dim filename As String
  3. Dim filepath As String
  4. filename = Me.Title0.Caption
  5. filepath = "Desktop\Paths" & filename & ".pdf"
  6. DoCmd.OutputTo acOutputReport, "reportall", acFormatPDF, filepath
  7. MsgBox ("Successfully saved as PDF")
  8. End Sub
Thank is advance :)
Nov 23 '17 #1

✓ answered by jimatqsi

What version of Office are you using? There are some posts on the 'Net about having to install service packs to various Office versions in order to have the necessary formats for the OutputTo command. Is your system fully updated?

Jim

Share this Question
Share on Google+
2 Replies


Expert 100+
P: 1,221
What version of Office are you using? There are some posts on the 'Net about having to install service packs to various Office versions in order to have the necessary formats for the OutputTo command. Is your system fully updated?

Jim
Nov 23 '17 #2

P: 12
I installed office 365 and it works all fine for now.
Thanks
Nov 29 '17 #3

Post your reply

Sign in to post your reply or Sign up for a free account.