title: How can I avoid opening the access and yet get report by ID in DoCmd.OpenReport
body: <p>I have the following code in a console app in C#:</p>
  
  <pre><code>DoCmd.OpenReport("My Report", AcView.acViewReport, Missing.Value, 'ID = 5', AcWindowMode.acWindowNormal, Type.Missing);
  
  DoCmd.OutputTo(AcOutputObjectType.acOutputReport, Type.Missing, "PDF Format (*.pdf)", $"MyReport.pdf", false, Type.Missing, Type.Missing, AcExportQuality.acExportQualityPrint);
  </code></pre>
  
  <p>What I want it to do is NOT to open the report but produce the report based on the where condition I sent ... Is it achievable.. ? </p>
  
  <p>I have a problem where I need to produce all reports for an mdb access database based on the IDs sent to it.</p>
  
  <p>Also when this code opens it still asks for ID .. not sure why.</p>