title: MS Access save record as PDF using ID
body: <p>My organization uses a MS Access database to store incident reports. I have a report called "Case Details" and I want to have the option to save the report that's currently open as a PDF. I've got it working for the most part, the only issue is that when saving the PDF, it's saving all of the records, not just the record that was being viewed.</p>
  
  <p>How do I fix it so that it only saves the record being viewed, using the record's ID?</p>
  
  <p>Here's the code for the save button.</p>
  
  <pre><code>Private Sub Command1626_Click()
  DoCmd.OutputTo acOutputReport, "Case Details", acFormatPDF, "G:\Police\Restricted\Saved Reports\ " &amp; Me.txtPDFRef &amp; ".pdf", True
  End Sub
  </code></pre>
  
  <p>The "txtPDFRef" box on the report contains the following code, which is used to name the report. (Case Number - Officer - Date Saved) </p>
  
  <pre><code>="CR" &amp; Format(Date(),"yy") &amp; "-000" &amp; [ID] &amp; " - " &amp; [ReportingOfficer] &amp; " - " &amp; Format(Date(),"yyyymmdd")
  </code></pre>