I want to simply export a report to PDF format. I know you can do it by clicking the "PDF or XPS" button under the "Data" section of the ribbon. How can you do this programmatically? I tried the below code but I keep getting Run-time error '2501'.
Code:DoCmd.OutputTo acOutputReport, "rptDivBreakdown", "*.pdf", vExportPath