title: Access VBA - Export Access Form to PDF then Close the Adobe Reader
body: <p>I have a VBA code in Access that exports/saves 3 seperate Access Forms to a PDF for record purposes.  However, upon completion, Adobe Reader opens the Forms that were saved, requiring the processor to manually close all 3 forms.  3 forms doesn't sound like much but they will be completing this process continuously for all 239 of our entities! This means they will have to manually click Close over 700 times a day!  So much for efficiency.</p>
  
  <p>Is there a VBA code to close the PDF in Adobe Reader?</p>
  
  <p>Below is the code that I am currently using:</p>
  
  <pre><code>Private Sub Command4_Click()
  DoCmd.SetWarnings False
  
  DoCmd.OpenQuery "Add to Completed", acViewNormal
  DoCmd.OpenQuery "Clear from Master", acViewNormal
  DoCmd.OpenQuery "Completed Totals", acViewNormal
  DoCmd.OpenQuery "Update AB Totals", acViewNormal
  DoCmd.OpenQuery "Update CD Totals", acViewNormal
  DoCmd.OpenQuery "Update EF Totals", acViewNormal
  DoCmd.OpenQuery "Update YTD Total", acViewNormal
  
  DoCmd.OpenForm "Form123-pg1", acPreview
  DoCmd.PrintOut acPrintAll
  **DoCmd.OutputTo acOutputForm, "Form123-pg1", acFormatPDF, "Z:\Corporate\SubProcess\2014\" &amp; Format(Date - 30, "mmyy") &amp; " - " &amp; [Forms]![Deal_Nav]![cbo_UnitNo] &amp; " ReportName Pg1.pdf", True**
  DoCmd.Close acForm, "Form123-pg1", acSaveNo
  DoCmd.OpenForm "Form123-pg2", acPreview
  DoCmd.PrintOut acPrintAll
  **DoCmd.OutputTo acOutputForm, "Form123-pg2", acFormatPDF, "Z:\Corporate\SubProcess\2014\" &amp; Format(Date - 30, "mmyy") &amp; " - " &amp; [Forms]![Deal_Nav]![cbo_UnitNo] &amp; " ReportName Pg2.pdf", True**
  DoCmd.Close acForm, "Form123-pg2", acSaveNo
  DoCmd.OpenForm "Form123-pg3", acPreview
  DoCmd.PrintOut acPrintAll
  **DoCmd.OutputTo acOutputForm, "Form123-pg3", acFormatPDF, "Z:\Corporate\SubProcess\2014\" &amp; Format(Date - 30, "mmyy") &amp; " - " &amp; [Forms]![Deal_Nav]![cbo_UnitNo] &amp; " ReportName Pg3.pdf", True**
  DoCmd.Close acForm, "Form123-pg3", acSaveNo
  
  Me.Requery
  Me.Refresh
  DoCmd.SetWarnings True
  </code></pre>
  
  <p>End Sub</p>