Hi,
I'm having trouble getting this delete statment to work.
here is my function, when you press the button it is supposed to delete the currently selected record.
Private Sub DeleteRecordButton_Click()
Dim dbs As Database, rst As Recordset
Set dbs = CurrentDb
dbs.Execute "DELETE * FROM BREAKS WHERE MainID = [Forms]![BreaksForm]![MainID]"
End Sub
Problem is I get a Run Time error that says "to few parameters. expected 1"
I can't figure it out... if I Just change it to hard code a certain MainID then it works.
Private Sub DeleteRecordButton_Click()
Dim dbs As Database, rst As Recordset
Set dbs = CurrentDb
dbs.Execute "DELETE * FROM BREAKS WHERE MainID = 543
End Sub
this works fine..and it deletes the record off the BREAKS table with MainID = 543.
Any help would be great..thanks.
I'm having trouble getting this delete statment to work.
here is my function, when you press the button it is supposed to delete the currently selected record.
Private Sub DeleteRecordButton_Click()
Dim dbs As Database, rst As Recordset
Set dbs = CurrentDb
dbs.Execute "DELETE * FROM BREAKS WHERE MainID = [Forms]![BreaksForm]![MainID]"
End Sub
Problem is I get a Run Time error that says "to few parameters. expected 1"
I can't figure it out... if I Just change it to hard code a certain MainID then it works.
Private Sub DeleteRecordButton_Click()
Dim dbs As Database, rst As Recordset
Set dbs = CurrentDb
dbs.Execute "DELETE * FROM BREAKS WHERE MainID = 543
End Sub
this works fine..and it deletes the record off the BREAKS table with MainID = 543.
Any help would be great..thanks.