Print 100 one page reports

MS Access:  This VBA code can be used to separate a single Access Report into unique single paged reports based on a value.  For example, a report with 100 payout statements can be separated into 100 single page statements.

Private Sub Report_Click()

Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim MyFileName As String
Dim mypath As String
Dim temp As String

mypath = "PATH\Access PDF Testing\"

Set db = CurrentDb()

Set rs = db.OpenRecordset("SELECT [GROUP] FROM [QUERY]", dbOpenSnapshot)

Do While Not rs.EOF

temp = rs("GROUP")
MyFileName = rs("GROUP") & ".PDF"

DoCmd.OpenReport "REPORT", acViewReport, , "[GROUP]='" & temp & "'"
DoCmd.OutputTo acOutputReport, "", acFormatPDF, mypath & MyFileName
DoCmd.Close acReport, "REPORT"


Set rs = Nothing
Set db = Nothing

End Sub