I have this Access 2010 VBA code that works on computer with Access 2010, but got error on computer with Access 2013 or 2016:
DoCmd.OpenReport "rptArchiveRequest", acViewPreview
DoCmd.OutputTo acOutputReport, "rptArchiveRequest", acFormatPDF, "C:\ArchiveRequest.pdf", False
The error reads:
"Run-time error '2282':
The format in which you are attempting to output the current object is not available"
If I replace acFormatPDF
then it works on all versions of Access. But I do need PDF format.
Also, the Intellisense doesn't List Properties/Methods for OutputFormat
parameter (on Access 2013 and Access 2016 computers).
Do you know what causes it and how to resolve this error?