I've tried to find a solution to this but can't find anything conclusive, so I need some help with my code please.
I have a form that has three . One combo to select a report, another combo to select a department to filter by, and a button to create the filtered report.
I have the below code on the button onclick event which produces a view of the filtered report as required:
How would I change this code to directly export the filtered report, titled whatever the value is in Me.DepNameBox, as a PDF to a specific directory?
Thanks
I have a form that has three . One combo to select a report, another combo to select a department to filter by, and a button to create the filtered report.
I have the below code on the button onclick event which produces a view of the filtered report as required:
Code:
Private Sub CreateReportBtn_Click()
DoCmd.OpenReport reportName:=RepNameBox, view:=acViewReport, whereCondition:="dept='" & Me.DepNameBox & "' OR 'All'='" & Me.DepNameBox & "'"
DoCmd.Maximize
Me.RepNameBox = Null
End Sub
How would I change this code to directly export the filtered report, titled whatever the value is in Me.DepNameBox, as a PDF to a specific directory?
Thanks
Last edited: