I have a problem with deleting records. I have a form in my database where I have included a delete button. The delete function works perfectly with an access tables (backend). When I connect that same form to the converted SQL tables (backend) it gives me an error message: run time error '3146' ODBC --call failed.
Here is my code:
Private Sub Command466_Click()
If IsNull([AsirID]) Then
MsgBox "The record contains insufficient information to delete", vbInformation, "OSMS"
ElseIf Not IsNull([AsirID]) Then
Dim lresponse As Integer
lresponse = MsgBox("Are you sure you want to permanently delete this record number from the OSMS database?", vbYesNo, "OSMS")
If lresponse = vbYes Then
Recordset.Delete
ElseIf lresponse = vbNo Then
DoCmd.CancelEvent
End If
What am I doing wrong?
Here is my code:
Private Sub Command466_Click()
If IsNull([AsirID]) Then
MsgBox "The record contains insufficient information to delete", vbInformation, "OSMS"
ElseIf Not IsNull([AsirID]) Then
Dim lresponse As Integer
lresponse = MsgBox("Are you sure you want to permanently delete this record number from the OSMS database?", vbYesNo, "OSMS")
If lresponse = vbYes Then
Recordset.Delete
ElseIf lresponse = vbNo Then
DoCmd.CancelEvent
End If
What am I doing wrong?