PaquettePaul
Member
- Local time
- Today, 15:38
- Joined
- Mar 28, 2022
- Messages
- 107
Common subroutine that displays, prints, and create PDF files For different reports
gblReportSelection “rptEventInvoice”
gblFilter = “EventPK = “ & Me!cmbInvoices
Case 1 ‘print preview
DoCmd.OpenReport gblReportSelection, acViewPreview
Case 2 ‘send to printer
DoCmd.OpenReport gblReportSelection, acViewNormal
Case 3 ‘create PDF file
gblText = gblDirectoryPath & ”\” & ”stFileName & “.pdf”
DoCmd.OutputTo acOutputReport, gblReportSelection, acFormatPDF, gblText
when I select an Invoice to report and then select Case 1, I see a print preview of the requested invoice. When I select Case 2 or Case 3, it ignores the invoice key and only prints the the last invoice on file.
suggestions as to what I am doing wrong. I would think that the report would work the same regardless of the output method.
gblReportSelection “rptEventInvoice”
gblFilter = “EventPK = “ & Me!cmbInvoices
Case 1 ‘print preview
DoCmd.OpenReport gblReportSelection, acViewPreview
Case 2 ‘send to printer
DoCmd.OpenReport gblReportSelection, acViewNormal
Case 3 ‘create PDF file
gblText = gblDirectoryPath & ”\” & ”stFileName & “.pdf”
DoCmd.OutputTo acOutputReport, gblReportSelection, acFormatPDF, gblText
when I select an Invoice to report and then select Case 1, I see a print preview of the requested invoice. When I select Case 2 or Case 3, it ignores the invoice key and only prints the the last invoice on file.
suggestions as to what I am doing wrong. I would think that the report would work the same regardless of the output method.