Once again I'm having trouble.

I used the code from Beacon's tutorial :

vb Code:
  1. Private Sub cmdDelete_Click()    
  2. If MsgBox("Are you sure you want to delete this record?", vbYesNo + vbQuestion, "Delete?") = vbNo Then      
  3. 'check if you really want to delete this record        
  4. Exit Sub 'exit the command    
  5. Else        
  6.     If Not (rs.BOF = True Or rs.EOF = True) Then            
  7.         rs.Delete 'delete the current record            
  8.             If Not (rs.BOF = True Or rs.EOF = True) Then                
  9.                rs.MoveNext 'move next            
  10.                   If rs.EOF Then rs.MoveLast                
  11.                   fillfields            
  12.            End If        
  13.     End If    
  14. End If
  15. End Sub

but everytime I try to delete the record I get the 3021 error.

"Either BOF or EOF is True, or the current record has been deleted.