debsamguru
Member
- Local time
- Today, 19:15
- Joined
- Oct 24, 2010
- Messages
- 82
OK. I've solved it.
The fact that it was sometimes doing the delete and other times not was really doing my head in! I finally put a msgbox in with the errorcode from the dbFailOnError. This came back with a code of 128 (sometimes) so I put the following code in:
This meant that if the record had not been committed yet, I could do an undo and it would work.
The fact that it was sometimes doing the delete and other times not was really doing my head in! I finally put a msgbox in with the errorcode from the dbFailOnError. This came back with a code of 128 (sometimes) so I put the following code in:
Code:
sqlquery = "DELETE * FROM OrderHeaderT WHERE ID = " & POIDInput
db.Execute sqlquery, dbFailOnError
If dbFailOnError = 128 Then
Me.Undo
End If