Hello,
I have the following code to delete data on a table using a form, but I am getting a Run-time error '3061': Too few parameters. Expected 1.
I am using this code in another form/table in my database and it works perfectly, but for some reason it is not working for the form/table I want to use now. What am I missing?
Thank you,
Miriam
I have the following code to delete data on a table using a form, but I am getting a Run-time error '3061': Too few parameters. Expected 1.
I am using this code in another form/table in my database and it works perfectly, but for some reason it is not working for the form/table I want to use now. What am I missing?
Code:
Private Sub DeleteUser_Click()
If MsgBox("Are you sure you want to delete?", vbYesNo) = vbYes Then
CurrentDb.Execute "DELETE FROM Employees" & _
" WHERE UserName =" & Me.UserName
End If
Thank you,
Miriam
Last edited: