title: Run time error 3021- no current record for delete button
body: <p>I have the following code for a delete button written in visual basics in Microsoft Access.</p>
  
  <pre><code>Private Sub Delete_Click()
  If Not (Me.ComputerSubform.Form.Recordset.EOF And Me.ComputerSubform.Form.Recordset.BOF) Then
      If MsgBox("Are you sure to delete?", vbYesNo) = vbYes Then
          CurrentDb.Execute "DELETE FROM Computer " &amp; _
                  " WHERE PCSN=" &amp; Me.ComputerSubform.Form.Recordset.Fields("PCSN")
        Me.ComputerSubform.Form.Requery    
      End If
     End If
  End Sub
  </code></pre>
  
  <p>The first time it words fine. But when I try to delete another record I will encounter "Run time error 3021- no current record". I could not understand as the code look fines to me and there is data available. I would appreciate any help. Thanks!</p>
  
  <p>P.S. I am sorry I can't post my table as it contain alot of confidential data.</p>