title: How to get record number in a continuous form?
body: <p>I am creating a form in MS Access. Its "detail" section is set to "continuous form". I am filtering the result based on some criteria, so that when the form runs, it shows only filtered results. </p>
  
  <p>I have also included a command button in the details section of the same form. </p>
  
  <p>When I click that command button, which appears in front of every record in the filtered results in the form, I want to display a message box. The message box shall display the ID (which is autonumbered) for that particular record. </p>
  
  <p>I am trying something like this:</p>
  
  <pre><code>Private Sub cmdSelect_Click()
  
      Dim MyDB As DAO.Database
      Dim MyRec As DAO.Recordset
  
      Set MyDB = CurrentDb
      Set MyRec = MyDB.Recordsets
  
      MsgBox MyRec![Artifact ID]
  
      'MsgBox CurrentRecord![Artifact ID]
  
      Set MyDB = Nothing
      Set MyRec = Nothing
  
  End Sub
  </code></pre>
  
  <p>However, it gives an error. </p>
  
  <p>Please help me. </p>
  
  <p>Thank you.</p>