I have created a form to delete a record from a certain table. It contains a field where the user can type the ID of the record that he wants to get rid of (field name: "idp"). The deletion is validated clicking a button. Behind the button I have the following code:
Private Sub button12_Click()
Dim dbs As Database, rst As Recordset
Set dbs = CurrentDb
dbs.Execute "DELETE * FROM " _
& "mytable WHERE ID = Me.idp;"
dbs.Close
DoCmd.Close End Sub
However, I keep getting error 3061 when trying to use it. ("error 3061 too few parameters. expected 1") I would appreciate your help, guys.