Save Access Report to PDF

I have a report in Access that will create a bunch of letters based on a date range. There are usually 15-20 letters each time, but it is really one batch report. Is there a way to save each letter as a separate pdf in vba? I have seen where the entire 15-20 page report can be saved as one pdf, but my users are picky..."then we have to extract each letter one at a time..."

I don't have a direct answer to your question, short of iterating through the pages in the macro and first only printing page 1 to pdf, then printing only page 2 to pdf, etc.

A good alternative would be to use a separate splitting program, like PDFSAM (PDF Split and Merge). I use it frequently to split large PDF files, it is free and open source and very useful. http://sourceforge.net/projects/pdfsam/
There are more program details at http://www.pdfsam.org/ but the installer there contains ads; the sourceforge download does not.

This is air code (no variables declared, untested) but it should give you the idea. You have a control on a form that will hold the ID field. Each time through the loop, you put in a new value so when you open the report, the report's RecordSource query can read the value and filter the report.

To take PatHartman's code just one step further. I generally open the report first, so you only have to open it once. Then I loop through the records in the recordset. Opening and closing the report can take a significant amount of time, so you can save some by only opening it once, and then applying a filter to the opened report before using the OutputTo method.

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Ok, so I'm an idiot. I guess I do not have permission to save to my C: drive.

PartHartman, your suggestion worked when I saved it to out network drive.

Also, thanks fyed, but I slightly changed how the process works. No longer do we produce the letters in batch. Once the record is entered, the letter is produced at that time, so no need to look through records. Thanks for your input though.

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…

Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…

With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship.
Add the tables:
Create the relationship:
Decide if you’re going to set referential integrity:
Decide if you want cascade upda…