trap access vba messages
<p>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</p>

<pre><code>On Error GoTo PROC_ERR
...
DoCmd.RunSQL szSQL
...
PROC_ERR:
  MsgBox "Error: (" &amp; Err.Number &amp; ") " &amp; Err.Description, vbCritical
</code></pre>

<p>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."</p>

<p>In VBA options I have for the moment set Error Trapping to "Break on all errors".</p>

<p>What am I missing here? Have I failed to set some other option in Access?</p>