Hi all, i have to delete some record from access database, at the moment i can insert and view data with this code:

For insert:
PercFile = ActiveWorkbook.Path _
& "\db1.mdb"
Set db = OpenDatabase(PercFile)
Set rs = db.OpenRecordset("Table", dbOpenTable)
Do While Cells(a ,b) > 0 then
With rs
.AddNew
.Fields("Data") = Cells(a, b)
.Update
End With
Loop
rs.Close
Set rs = Nothing
db.Close
Set db = Nothing


For view:
PercFile = ActiveWorkbook.Path _
& "\db1.mdb"
conn.Open ConnectionString:= _
"Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & PercFile
rst.Open "Table", conn, adOpenStatic
With rst
Do While Not .EOF
If rst.Fields("Number")=n Then
Cells(a , b) = .Fields("Name")
End If
.MoveNext
Loop
End With
conn.Close

i have try to modify the code that insert a record, with a .Delete that replace the .AddNew method but i obtain an error

Some idea?
thanks in advance