Some developers try to enhance their error handling with writing log files or sending e-mail. There are some issues involved with these error-handling techniques, as explained in the following sections.
Some developers write code to insert an error log record into a table or text file when an error occurs. The idea is to be able to analyze when and where errors have occurred by querying this table long after the errors happened. However, this technique has some issues.
Access does not provide a way to determine the name of the procedure that is currently running. Because any error logging routine needs to know which procedure caused the error, you need to manually code the name of the current procedure into each error routine. That is labor intensive and prone to errors.
The benefit of error logging is questionable because few errors should be happening after your code has been tested and delivered. Errors should be rare enough that your users will let you know when they happen. You can always ask them to capture a screenshot if you want to see the details.
Some types of errors cause the attempt to log them to fail. Examples include loss of network connectivity, and disconnected storage hardware. Your user may see additional unrelated errors, or you could be lulled into thinking that all errors are logged, when they may not be.
If your code is running in a managed environment, it may be beneficial to log ...