L
Lloyd
Using Access 2007, I output a report to a singe PDF file that consists of
invoices grouped by company. i would like to create a seperate PDF for each
company. Some companies invoice data consists of multiple pages. I am
attempting to do this using the OutPutTo command. I need help with filtering
the data for each report. Each Report will be title companyName.PDF. My code
is:
Dim rs As DAO.Recordset
Dim db As Database
Dim CompanyName As String
Set db = CurrentDb
Set rs = db.OpenRecordset("rpt-hgrpinv")
Do While Not rs.EOF
CompanyName = rs!CoShortName
strRepName = "MyReportName"
strPath = "C:\folder\"
strCustomFileName = CompanyName & " Invoice Report"
DoCmd.OutputTo acOutputReport, strRepName, acFormatPDF, strPath &
strCustomFileName & ".pdf", False, "", 0, acExportQualityPrint
rs.MoveNext
Loop
End
Lloyd
invoices grouped by company. i would like to create a seperate PDF for each
company. Some companies invoice data consists of multiple pages. I am
attempting to do this using the OutPutTo command. I need help with filtering
the data for each report. Each Report will be title companyName.PDF. My code
is:
Dim rs As DAO.Recordset
Dim db As Database
Dim CompanyName As String
Set db = CurrentDb
Set rs = db.OpenRecordset("rpt-hgrpinv")
Do While Not rs.EOF
CompanyName = rs!CoShortName
strRepName = "MyReportName"
strPath = "C:\folder\"
strCustomFileName = CompanyName & " Invoice Report"
DoCmd.OutputTo acOutputReport, strRepName, acFormatPDF, strPath &
strCustomFileName & ".pdf", False, "", 0, acExportQualityPrint
rs.MoveNext
Loop
End
Lloyd