Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2010
    Location
    UK
    Posts
    160

    Unanswered: File name based off a Field in a report.

    Hi there,

    When i view my orders in a report i publish them to PDF using the PDF or XPS button in the toolbar.

    At the moment the file name is the same as the Report name, but i was wondering whether it is possible to pull the name from a field in the report to use as the file name when converting to pdf?

    thanks
    marcus
    Last edited by marcusmacman; 03-16-12 at 17:15.

  2. #2
    Join Date
    Jan 2012
    Posts
    97
    You could declare a variable, for example PDFname, as string, set the variable to the name of the control on the report then use the variable in the output command. See rough idea below...

    Code:
    Dim fldname as string
    PDFname= mycontrol & ".pdf"
    DoCmd.OutputTo acOutputReport, "rptName", acFormatPDF, PDFname
    Hope this helps,

    Dave.

    _____________

    Access 2000 User

Posting Permissions

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