Question : dbSeeChanges error on SQL DELETE

I get a "Must use dbSeeChanges" error when executing a DELETE statement. But when I insert dbSeeChanges as an option, I get: "Expected =".

Setup: I am using Access as a front end to a SQL Server Database (linked tables).

Please help, thanks.

Code:

Private Sub cmdDelete_Click()
Dim intID As Integer
   
If Me.txtModuleID > 0 Then
Set db = CurrentDb
intID = Me.txtModuleID
       
 If (MsgBox("Delete this module and references to all lessons?",vbYesNo,"Warning") = vbYes)Then
 db.Execute ("DELETE FROM Module WHERE ModuleID = " & intID)
 db.Execute ("DELETE FROM ModuleLesson WHERE ModuleID = " & intID)
 db.Execute ("DELETE FROM CourseModule WHERE ModuleID = " & intID)

Form.Requery
End If
End If

End Sub

Answer : dbSeeChanges error on SQL DELETE

Try taking the parens out of the syntax.  None of the examples in Access help use them, and they might be modifying the action of the Execute method.

Then post what happens back here, if you would.

Brian
Random Solutions  
 
programming4us programming4us