title: Microsoft Access How to retrieve current form ID to print
body: <p>I am trying to print a report called Carton Labels, and I want to print a specific record that the user just created. Every time I try using Me.cartonNo which is a actual field on the current form the user is on. He gets prompted for input. What am I doing wrong?</p>
  
  <p><img src="https://i.stack.imgur.com/ZY7it.png" alt="enter image description here"></p>
  
  <p>EDIT: </p>
  
  <pre><code>Dim strDocName As String
  Dim strFilter As String
  
  DoCmd.RunCommand acCmdSaveRecord
  
  strDocName = "Carton Labels"
  strFilter = "[cartonNo] = Forms![frm_addFinishedGoodsInventory]![cartonNo]"
  
  DoCmd.OpenReport strDocName, acViewPreview, strFilter
  </code></pre>
  
  <p>my print button doesn't work, it acts as if nothing was stored in the strFilter, but if I create Dim intFilter As Integer and store it into a integer, I can clearly see the cartonNo if I set a break point, yet I dont in the strFilter.</p>