title: DoCmd.OutputTo acOutputReport and OpenArgs Workaround
body: <p>I have a report used by any report the yields zero records.  The reports title tells what process had zero records.</p>
  
  <p>strNoRecordOpenArg is a Global Veriable</p>
  
  <p>Main Form Code **</p>
  
  <pre><code>strNoRecordOpenArg = "Imported AEL's"
  DoCmd.OutputTo acOutputReport, "rpt_universal_no_records", acFormatPDF, "C:\Reports\Imported AEL's.pdf"
  strNoRecordOpenArg = ""
  </code></pre>
  
  <p>Report Code **</p>
  
  <pre><code>Private Sub Report_Open(Cancel As Integer)
  .txt_header_title.ControlSource = "=""" &amp; strNoRecordOpenArg &amp; """"
  End Sub
  </code></pre>
  
  <p>What happens is that the process completes with no report generated.</p>
  
  <p>If I rem out the Report Code it works but the Report Title is #Name. </p>
  
  <p>I use the Immediate window and the value of strNoRecordOpenArg is holding and should be available for the open report process.</p>
  
  <p>All of this is to completely automate the process.  If I use </p>
  
  <pre><code>DoCmd.OpenReport "rpt_universal_no_records", , "", "", acWindowNormal, "Imported AELs"
  </code></pre>
  
  <p>and use the openarg to feed the report title, everything works but you get prompted to save the file as.</p>
  
  <p>Any Ideas?</p>
  
  <p>Tank you!</p>