title: Access Report - Print Preview Won't Print
body: <p>I have a macro that opens a report in print preview, with the current record displayed.  The report pulls information from the same form that this print preview button is on.</p>
  
  <p>The problem is, sometimes the print button works and prints the single report record, other times it prints every single record in the form format.</p>
  
  <p>Here is the code linked to a button in the form:</p>
  
  <pre><code>Private Sub Print_Record_Click()
  'Save and print record
  
  On Error GoTo Err_Msg
  
  CurrentDb.Execute "qryOrderQty", dbFailOnError
  DoCmd.RunCommand acCmdSaveRecord
  
  DoCmd.OpenReport "rptWorkOrder", acViewPreview, , "Prod_Num = " &amp; Me!Prod_Num
  
  Exit Sub
  
  Err_Msg:
      MsgBox Err.Description
  
  End Sub
  </code></pre>
  
  <p>Not sure if it helps, but here are some circumstances that I think lead to whether or not the error occurs.  We'll call the report and form above Report1 and Form1, respectively.</p>
  
  <p>Report prints as expected:</p>
  
  <ol>
  <li>User opens database on front page</li>
  <li>Clicks button on front page to open Form1 and enters information</li>
  <li>Clicks Print Preview button, activating macro above</li>
  <li>Clicks Print button in ribbon, Report1 prints single record</li>
  </ol>
  
  <p>Form prints all records:</p>
  
  <ol>
  <li>User opens database on front page</li>
  <li>Clicks button on front page to open Form2 and enters information</li>
  <li>Clicks button on Form 2 to open Form1 and enters information</li>
  <li>Clicks Print Preview button, activation macro above</li>
  <li>Clicks Print button in ribbon, Form1 prints ALL records</li>
  </ol>