logo
search
File Format & Compatibility

How to Split an Access Report into Separate PDF Files

Steven ParkerSteven Parker Oct 16, 2026 869 views

Question details

The user needs to export a single Microsoft Access report into multiple individual PDF files, automatically naming each file based on a specific field value (such as a person's name).

How to Split an Access Report into Separate PDF Files
Product
Microsoft Access
Device & OS
not provided
Scenario
Generating and saving personalized PDF reports for different individuals or groups from a master Access database report.
Observed behavior
A single comprehensive Access report must be programmatically divided and saved as distinct PDF files using VBA.
Before you start

Ensure you have backed up your Microsoft Access database and have basic familiarity with writing and executing Visual Basic for Applications (VBA) code.

Solution 1Recommended

Use a VBA Loop to Filter and Export PDFs

The most reliable method is to create a VBA procedure that loops through your target records, filters the report for one individual at a time, and exports the result as a PDF.

Exporting the entire report once and looping through page numbers can be unreliable due to pagination changes or group headers spanning multiple pages. Filtering the RecordSource or WhereCondition ensures each generated PDF accurately reflects only the data for that specific entity.

1
Open the VBA Editor

Launch your Microsoft Access database and press ALT + F11 to open the Visual Basic for Applications (VBA) editor.

2
Create a New Module

Click 'Insert' from the top menu and select 'Module' to create a new blank script window.

3
Write the Loop Procedure

Write a VBA sub-procedure that opens a Recordset containing the distinct names or IDs you want to generate reports for. Use a 'Do While Not rs.EOF' loop to iterate through each record.

4
Filter the Report

Inside the loop, use 'DoCmd.OpenReport' with the 'WhereCondition' parameter set to the current record's identifier (e.g., "[PersonID] = " & rs!PersonID) to filter the report.

5
Export to PDF

Use 'DoCmd.OutputTo acOutputReport, "YourReportName", acFormatPDF, "C:\Path\" & rs!PersonName & ".pdf"' to save the filtered report as a PDF.

6
Close and Loop

Close the report using 'DoCmd.Close acReport', advance the recordset with 'rs.MoveNext', and loop until finished.

Use a VBA Loop to Filter and Export PDFs
Handle Invalid Characters: Remember to write a small function to sanitize the 'rs!PersonName' variable to remove invalid filename characters (like slashes or colons) and append unique suffixes if duplicate names exist.
Free Microsoft Office alternative

Need a Lightweight Alternative for Your Everyday Office Tasks?

While Microsoft Access is necessary for complex relational database management and VBA reporting, WPS Office is an exceptional free alternative for handling your everyday documents, spreadsheets, and PDF files. It seamlessly opens Microsoft Office formats and includes powerful built-in PDF tools.

  1. 1. Download and Install: Visit the official WPS Office website to download and install the free suite on your device.
  2. 2. Open Your Files: Launch WPS Office to easily open your exported PDF reports or any existing Word, Excel, and PowerPoint documents.
  3. 3. Manage PDFs: Use the built-in PDF toolkit in WPS Office to merge, annotate, or further modify the separate PDF files generated from Access.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx).Features a robust built-in PDF editor to easily view, merge, split, and edit the PDF reports generated from your database.Free, lightweight, and fast-loading compared to the complete Microsoft Office suite.Familiar tabbed user interface ensures a seamless migration with zero learning curve.
microsoft office alternative - wps office

Frequently Asked Questions

Can I split an Access report into multiple PDFs without writing VBA code?

No, Microsoft Access does not have a built-in graphical feature to automatically burst or split a single report into multiple distinct PDF files. Writing a VBA macro is required to automate the filtering and exporting loop.

How do I prevent the VBA script from overwriting PDFs if two people have the same name?

In your VBA script, you should include logic that checks if a file with the target name already exists using the 'Dir()' function. If it does, append a unique identifier, such as a primary key ID or a timestamp, to the filename string before executing 'DoCmd.OutputTo'.

Why is it better to filter the RecordSource instead of looping through report pages?

Filtering the RecordSource ensures that the report calculates totals, headers, and footers correctly for that specific dataset. Looping through physical pages can lead to truncated data or incorrect summaries if an individual's report spans more than one page.