I'm developing in Access 2007 after a period doing other things and am trying to trap messages to the user. One function in a form modifies a row in a table. The relevant bits of the code are
On Error GoTo PROC_ERR
...
DoCmd.RunSQL szSQL
...
PROC_ERR:
MsgBox "Error: (" & Err.Number & ") " & Err.Description, vbCritical
The SQL statement is correct and he system pops up with a "You are about to update 1 row ..." message (number 10505). I want to trap this and replace it with my own warning message. However, my function doesn't trap an error on this message. Nor does it do so on the message that appears if the user clicks "no": "Run-time error 2501. The RunSQL action was canceled."
In VBA options I have for the moment set Error Trapping to "Break on all errors".
What am I missing here? Have I failed to set some other option in Access?