logo
search
Others

How to Export Access Report to PDF Without Preview Using VBA

John WilsonJohn Wilson Oct 12, 2026 869 views

Question details

The user needs to export a Microsoft Access report as a PDF directly via VBA without opening Print Preview or prompting the user with a Save As dialog box.

How to Export an Access Report Directly to PDF Without Preview
Product
Microsoft Access
Device & OS
not provided
Scenario
Automating the generation and saving of Access reports to a specific network or local folder as PDF files using VBA macros.
Observed behavior
Using DoCmd.OpenReport with acViewPreview forces the report to open, and omitting the report name in DoCmd.OutputTo triggers the Save Print Output As dialog box.
Before you start

Ensure that the destination folder path (e.g., your network drive or local directory) is accessible and that your Windows user account has write permissions to save files there.

Solution 1Recommended

Use OutputTo Method Without Opening the Report

Bypass the preview mode and save dialog by directly specifying the report name and file path in the OutputTo method.

The issue occurs because the VBA code opens the report in preview mode before attempting to export it, or it leaves the report name blank in the OutputTo command. By providing the exact report name to DoCmd.OutputTo and removing the OpenReport command, Access will export the file silently in the background.

1
Remove preview commands

Open your VBA editor and delete the DoCmd.OpenReport and DoCmd.Close commands from your macro, as these trigger the print preview window.

2
Define the file path

Declare a string variable for your destination path, for example: Filesavename = "Z:\CSC\5 - Metrics, Meetings, Reports\PGA&QCL\PGA QCL MAP sold.PDF"

3
Execute the OutputTo command

Add the modified output command ensuring the report name is explicitly stated: DoCmd.OutputTo acOutputReport, "PGA QCL MAP sold", acFormatPDF, Filesavename, False, , , acExportQualityPrint

Use OutputTo Method Without Opening the Report
Syntax check: Ensure the report name matches exactly what is in your Access database, otherwise the code will fail to find the report to export.
Free Microsoft Office alternative

Discover WPS Office for Your Document and PDF Needs

While Microsoft Access is used for database management, handling exported PDFs, spreadsheets, and documents can be seamlessly done with WPS Office. It is a free, lightweight, and powerful alternative to Microsoft Office.

  1. 1. Download the installer: Visit the official WPS Office website and download the free installation package for your operating system.
  2. 2. Install the software: Run the installer and follow the on-screen prompts to set up WPS Office on your device.
  3. 3. Open your exported PDFs: Use the built-in WPS PDF tool to easily read, annotate, or share the PDF reports you exported from your database.
Free and lightweight Office suiteSeamlessly view, edit, and manage exported PDF reportsHigh compatibility with Microsoft Word, Excel, and PowerPoint formatsFamiliar user interface for quick adoption without a learning curve
microsoft office alternative - wps office

Frequently Asked Questions

Why does Access display the 'Save Print Output As' dialog when I run my VBA code?

This happens if you leave the report name argument blank in the DoCmd.OutputTo method. Ensure you explicitly type the name of the report you want to export instead of using an empty string ("").

How do I silently overwrite an existing PDF report in Access?

The DoCmd.OutputTo method will automatically overwrite an existing file with the same name in the specified directory without prompting, as long as the file is not currently open in another application.

Can I use this VBA method to export reports to other formats?

Yes, by changing the OutputFormat argument from acFormatPDF to other constants like acFormatXLS or acFormatRTF, you can silently export reports to Excel or Word formats.