How to use vb code to run report with parameter query then save as pdf?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jmborron
    New Member
    • Aug 2010
    • 4

    How to use vb code to run report with parameter query then save as pdf?

    I have an Access report that is populated by a parameter query. I need to run the report for 250 different filters then save. How do I write a code that will run the report then save it as pdf250 times?

    Jason
  • Delerna
    Recognized Expert Top Contributor
    • Jan 2008
    • 1134

    #2
    Does it have to be pdf?

    Comment

    • Delerna
      Recognized Expert Top Contributor
      • Jan 2008
      • 1134

      #3
      if not this piece of code might help

      Code:
      DoCmd.OutputTo acOutputReport, "rptReportName", acFormatSNP, "c:\SaveFolderName\SavedReportName.SNP"
      Bind the report to a query that has the criteria for the necessary fields bound to textbox's on a form.

      On that form loop through a DAO recorset of the 250 report filters updating the filter textboxes and running the posted code above.

      Comment

      • jmborron
        New Member
        • Aug 2010
        • 4

        #4
        This is an A2007 that has the save as pdf add in. I think I can use the DoCmd code with acFormatPDF then save. I have very limited knowledge of VB it is the loop code that i'm not too sure about.

        Comment

        Working...