How to export a report with parameters to PDF?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Audrey Abbey

    #1

    How to export a report with parameters to PDF?

    In a nutshell, when I click the PDF export button, from the print preview screen, I am prompted to enter the parameters again.

    I assume I have skipped a step somewhere that saves the parameter data. OR, I should not be closing the form that collects the parameters until after the export is done.

    Long version (in case these details matter):
    I created a form to collect the parameters. End user inputs start/end dates into text boxes, then selects a category from the drop down menu.

    Command boxes allow the user to pull a report, pull a graph, or close the form. These are driven by the "On Click" event and simply opens the report in preview, then closes the form that collected the parameters.

    Report and Graph both display on the screen correctly. However, if I try to export to PDF, I get the parameter prompts again, plus, it doesn't display the parameters on the report/graph the way it does on the screen.

    Any help is appreciated.
  • Audrey Abbey

    #2
    Update: Removing the close form part of the code, from the "On Click" event works like a charm.

    Out of curiosity though, is there any way to preserve both functions? While having the form close automatically isn't critical, it sure is handy.

    Comment

    • dsatino
      Contributor
      • May 2010
      • 393

      #3
      I've never actually 'exported' to a pdf, but if that's the correct terminology for what you're doing then then issue is probably because a report is basically painted picture and you can't really 'export' that picture to a pdf so Access requeries the results. Since you've closed the form, your parameters are no longer available which is why it asks again.

      That said, you may want to 'Print' your report to PDF. I do that all the time and never get re-prompted for any parameters. PDF is basically a digital printer.

      Alternately, you could create Public date variables that capture the inputs, create public date funtions that return these values and set your parameters to these funtions. These variables will persist after the form is closed, so even if the PDF export/print requires them, they won't need to be re-entered.

      Comment

      Working...