Results 1 to 2 of 2
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Code to Click on Save (03)

    I found this snippet of code in the Lounge and was wondering what the code would be to click on the save button.

    Sub PrintIt()
    Dim prtDefault As Printer
    'remember the default so you can put it back later
    Set prtDefault = Application.Printer
    Set Application.Printer = Application.Printers("Adobe PDF")
    DoCmd.OpenReport "FileNameHere", acViewNormal
    ' put the default printer back
    Set Application.Printer = prtDefault
    End Sub



    Thanks,
    John

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Code to Click on Save (03)

    You could insert a line
    <code>
    SendKeys "{Enter}"
    </code>
    above the line that opens the report.

    Alternatively, you can use the free ReportToPDF function by Stephen Lebans. It lets you specify the path and filename of the PDF file.

Posting Permissions

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