Consulting

Results 1 to 2 of 2

Thread: Save report as .pdf

  1. #1

    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.

    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,
    Last edited by oxicottin; 10-14-2019 at 12:40 PM.

  2. #2
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,086
    Location
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •