what does this error message mean?

Harryvs

New member
Local time
Today, 23:47
Joined
Jul 16, 2007
Messages
4
Hello,

i have some trouble with deleting a record.
I'm trying to delete a record via a form from another table. I can add records and edit them but when i try to delete a record it gives the following error
TOO FEW PARAMETERS EXPECTED 1

my code is the following

Dim db As DAO.database
Dim rs As DAO.recordset

Set db = CurrentDb()
Set rs = db.OpenRecordset("Versterkingsritten")

With rs
.Index = "Code"
.Seek "=" , Code.Value
.Delete
.Close
End With

The .Index and .Seek work fine because i used them in some other code
but i keep getting that message

can some1 please tell me whats wrong

grtz
 
BTW, if feasible it would be more efficient to execute some SQL:

CurrentDb.Execute "DELETE * FROM TableName WHERE FieldName = " & Code.Value

or something along those lines.
 
No Versterkingsritten is a table

but i'll try using that query

thx for the help
 

Users who are viewing this thread

Back
Top Bottom