I am unable to delete a record from a Table. I get an error
"Syntax Error in query. Incomplete query clause"
The value of SqlSyntax shown in the messagebox is
DELETE FROM 'Daily Turn' WHERE DailyTurnID = 4796
I do not see anything wrong with this query. There is a relationship to two other
tables but the "Enforce ..." not not selected. Any ideas?
Dim tblName As String
tblName = "Daily Turn"
Const cstrPrompt As String = _
"Are you sure you want to delete this record? Yes/No"
If MsgBox(cstrPrompt, vbQuestion + vbYesNo) = vbYes Then
MsgBox "DailyTurnID = " & Me.DailyTurnID
SqlSyntax = "DELETE FROM '" & tblName & "' WHERE DailyTurnID = " & Me.DailyTurnID
MsgBox SqlSyntax
CurrentDb.Execute SqlSyntax
Call btnReturn_Click
Else 'user clicked no
MsgBox "Deletion was aborted.", vbInformation
End If