Thank you for your reply.
No I dont want to deal with keyboard button. The button I deal with is placed on a form. Your soultion looks good but I'm getting error and I have no idea how to solve it. The error:
Code:
Run-time error '3061'.
Too less parameters. Expected 1.
And the code.
Code:
Private Sub Delete_Click()
If MsgBox(Prompt:="My question", Buttons:=vbYesNo) = vbYes Then
CurrentDb.Execute "DELETE FROM Users WHERE ID=" & Me.IdUser
Else
MsgBox "Delete canceled"
End If
End Sub
Any idea?
Edit: Ah ok I solved it already. Forgot to change where Id to IdUser.
Thanks a lot . Problem Solved.