George-Bowyer
Registered User.
- Local time
- Today, 22:45
- Joined
- Dec 21, 2012
- Messages
- 177
I have a query to delete some records on the click of a button.
(I use one option or the other, not both)
If use the DoCmd line, the query runs fine.
However, if I use the Execute line (because I want to avoid the warnings), I get a 3061 error "Too few parameters. Expected 1"
For info, here is the sql of qryUnmarkUser
Can anyone tell me why the Execute option is throwing an error, please?
Many thanks,
George
Code:
Private Sub cmdUnmark_Click()
DoCmd.OpenQuery ("qryUnmarkUser")
CurrentDb.Execute "qryUnmarkUser", dbFailOnError
MsgBox "Records Unmarked"
End Sub
(I use one option or the other, not both)
If use the DoCmd line, the query runs fine.
However, if I use the Execute line (because I want to avoid the warnings), I get a 3061 error "Too few parameters. Expected 1"
For info, here is the sql of qryUnmarkUser
Code:
DELETE tblMarkedPeople.*, tblMarkedPeople.fldUserID
FROM tblMarkedPeople
WHERE (((tblMarkedPeople.fldUserID)=[Forms]![NavigationForm]![cmbUser]));
Can anyone tell me why the Execute option is throwing an error, please?
Many thanks,
George