Brief Description:
The purpose of this database is to have a simple form that inputs data into a table. There is a subform view on the form so they are able to see their data that was submitted into the table.
Problem:
I have made an attempt at making a Delete Row button. The idea behind this is to allow them to select a row on the subform view and then delete it from the table.
Form = frmEvaluationForm
Subform = frmReviewSubForm
Table = tblEvaluationDatabase
I am new to MS Access so I am just looking for any help in figuring out what is causing this error 3075 (syntax error in query expre. Is there a more specific way to delete a row that has been selected?
Access 2007
Thanks
Brian
The purpose of this database is to have a simple form that inputs data into a table. There is a subform view on the form so they are able to see their data that was submitted into the table.
Problem:
I have made an attempt at making a Delete Row button. The idea behind this is to allow them to select a row on the subform view and then delete it from the table.
Form = frmEvaluationForm
Subform = frmReviewSubForm
Table = tblEvaluationDatabase
I am new to MS Access so I am just looking for any help in figuring out what is causing this error 3075 (syntax error in query expre. Is there a more specific way to delete a row that has been selected?
Access 2007
Code:
Private Sub cmdDelete_Click()
'check existing selected record
If Not (Me.frmReviewSubForm.Form.Recordset.EOF And Me.frmReviewSubForm.Form.Recordset.BOF) Then
'confirm delete
If MsgBox("Delete this record?", vbQuestion + vbYesNo, "Delete") = vbYes Then
'delete now
[COLOR=black]CurrentDb.Execute "DELETE * FROM tblEvaluationDatabase WHERE CAccount [/COLOR][COLOR=black]= " & Me.txtCAccount[/COLOR]
'refresh data in list
Me.frmReviewSubForm.Form.Requery
End If
End If
End Sub
Thanks
Brian