-
Save report as .pdf
Hello, I have a report that isn't open BUT I want to save it to my desktop as a .pdf from a button and delete one if it has the same date and replace it. The report pulls data off the form I'm on. Also, if it needs t be open to save is there a way to open it hidden.
Code:
Dim strSViser As String
strSViser = Me.cboSupervisorName.Column(1)
DoCmd.OutputTo acOutputReport, "rpt_EmailDailyProduction", acFormatPDF, "C:\Users\" & Environ("username") & "\Desktop\" & Format(Date, "MM-dd-yyyy") & " " & strSViser & " Superlog.pdf"
Thanks,
-
First things first.
Your code looks OK, so what is it not doing?
When you say "Also, if it needs to be open to save is there a way to open it hidden." are you referring to the form or the report?
You do not currently have any code for identifying that the pdf file already exists and delete it, is that your question?