Print reports in individual PDF's

R

Ryan

I have tousands of reports all generated in one PDF it takes very long time
to make individual pdf's. Is there a way to print reports in individual pdf's
with naming from a field ?

Can someone help me with VB code?
 
G

Gina Whipp

Ryan,

Here's some code that will send the reports to RTF format. With some minor
modifications I belive you can get what you want...

'Posted by ADezii 5.23.2009 on bytes.com
'Modified by Gina Whipp 11.4.2009 to OutputTo Multiple Files
'Tested in Access 2003

Dim intCounter As Integer
Dim cboCode As ComboBox

Set cboCode = Me![YourControl]

'If Your Data Type is Numeric
For intCounter = 0 To cboCode.ListCount - 1
DoCmd.OpenReport "YourReport", acViewPreview, , "[YourFieldControlSource]
= " & cboCode.ItemData(intCounter)
DoEvents
DoCmd.OutputTo acReport, "YourReport", acFormatRTF,
"DriveLetter:\FolderName\FileName" & Format(intCounter, "000") & ".rtf"
DoCmd.Close acReport, "YourReport"
Next

'If Your Data Type is a String
For intCounter = 0 To cboCode.ListCount - 1
DoCmd.OpenReport "YourReport", acViewPreview, , "[YourFieldControlSource]
= '" &
cboCode.ItemData(intCounter) & "'"
DoEvents
DoCmd.OutputTo acReport, "YourReport", acFormatRTF,
"DriveLetter:\FolderName\FileName" & Format(intCounter, "000") & ".rtf"
DoCmd.Close acReport, "YourReport"
Next

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top