Private Sub Command1_Click()
VB Code:
  1. Dim objConn As ADODB.Connection
  2. Set objConn = New ADODB.Connection
  3. objConn.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\database\DB.mdb;Persist Security Info=False")
  4. Dim x As String
  5. dim rs1 as adodb.recordset
  6. Set rs1 = New ADODB.Recordset
  7.  
  8. x = " delete from data where inv ='" & Form29.Text1 & "'"
  9. rs1.Open x, objConn
  10. If rs1.EOF Then
  11. MsgBox ("INVOICE NOT FOUND")
  12. Else
  13. MsgBox ("INVOICE DELETED")
  14. Form30.Visible = False
  15. End If
  16. End Sub


when i run the above coe it gives error at line rs1.eof.. that operation can not be done when object is closed
tell me what is the problem