Here is an interesting one for you guys. On a form, I have two command buttons. Both of them call the same report. One of them displays the report and one of them outputs the report to a pdf file. However, the method of calling the report differs.
This command opens the report perfectly on the screen. a_Season(x,y) provides a 'start' and an 'end' date range.
Private Sub cmdClassSchedule_Click()
DoCmd.OpenReport "rpt_Class_Schedule", acViewReport, , _
"(left([Class_Type_Code],3) = 'GVR') AND [Date_1] >= #" & a_Season(1, 2) & _
"# AND [Date_1] <= #" & a_Season(1, 3) & "#"
End Sub
This command outputs the report to the appropriate pdf file.
Private Sub cmdCreatePDF_Click()
Dim strPath As String
strPath = CurrentProject.Path
DoCmd.OutputTo acOutputReport, "rpt_Class_Schedule", "PDF Format", strPath & "\Class_Schedule.pdf"
End Sub
My issues is that I need to send the file to a pdf file but the DoCmd.OutputTo command doesn't all for the filter.
I don't want to have to create two identical reports with different queries.
any ideas?