View Full Version : what does this error message mean?


Harryvs
07-26-2007, 12:54 PM
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

pbaldy
07-26-2007, 01:16 PM
Perhaps this, if "Versterkingsritten" is a query with a parameter:

http://support.microsoft.com/default.aspx?scid=kb;en-us;209203

pbaldy
07-26-2007, 01:18 PM
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.

Harryvs
07-26-2007, 02:02 PM
No Versterkingsritten is a table

but i'll try using that query

thx for the help