I am trying to improve my error handling code.
Using Access (2007) VBA:
When an error occurs in the forms On Error handler the variable DataErr gives me the error code but I have no access to the Err object.
Access to the Err object allows me to parse the error description and give a detailed custom message (eg error code 3314 exactly which field is causing the error) to the user
How can I have access to the Err object from the form's OnError handler? Not only the error code
Note: I can access the Err object from code attached to the "save" and "delete" buttons on my form and give customised messages for duplicate keys, missing required fields, linked reecords that can not be deleted,etc.
This works fine if the user clicks these button. But if the user decides to select the next or previous row - which causes a save to occur - my code is not called and the user gets shown the standard MS Access error message