title: VB6 Error: Runtime error 3021. Either BOF or EOF is true or the current record has been deleted. Requested operation requires a current record
body: <p>This is my code:</p>
  
  <pre><code>Dim c As Integer
  Private Sub Command4_Click()
  c = InputBox("ENTER STAFF ID")
  Form6.Adodc1.Refresh
  Form6.Adodc1.Recordset.MoveFirst `ERROR
  While Form6.Adodc1.Recordset.EOF &lt;&gt; True
  If Form6.Adodc1.Recordset.Fields(0) = Val(c) Then
  Text1.Text = Form6.Adodc1.Recordset.Fields(0)
  Text1.Enabled = False
  Text2.Text = Form6.Adodc1.Recordset.Fields(1)
  Text3.Text = Form6.Adodc1.Recordset.Fields(2)
  Text4.Text = Form6.Adodc1.Recordset.Fields(5)
  DTPicker2.Enabled = False
  DTPicker1.Enabled = False
  MsgBox "AFTER EDITING CLICK ON UPDATE"
  Command2.Enabled = True
  Exit Sub
  Else
  Form6.Adodc1.Recordset.MoveNext
  End If
  Wend
  MsgBox "ENTER CORRECT STAFF ID"
  End Sub
  </code></pre>
  
  <p>This is the error I have received during runtime:</p>
  
  <pre><code>VB6 Error: Runtime error 3021. Either BOF or EOF is true or the current record has been deleted. Requested operation requires a current record. 
  </code></pre>
  
  <p>I have already the other questions, I haven't got an answer in those solved ones as this is in VB6. I have also mentioned in which do i get the error when I click on debug. TIA</p>