It seems that most error handling code is designed to display a message
and/or log errors in a table and then exit the procedure altogether. This
may leave some of the calling procedure's code unexecuted, which could be
problematic. Is it considered poor programming practise to resume the
execution of the calling procedure (using Resume Next) after the error
handling is done, rather than exiting the procedure?
Different situations call for different handling. You have to determine the level of severity of the error, and how it
impacts the rest of the code execution. It's not unusual to Resume Next, if the error is determined to be non-fatal or
you somehow fix the error - for example, if your code expects to open a text file, and the file isn't found, you may
open a FileOpenSave dialog for the user to locate the file ... it that succeeds, you may then use some variantion of
Resume to take the user back to correct place.
However,in many cases you're better off handling things inline before they get to Error ... for example, if your code
MUST have the above mentioned file, you'd be better advised to check for this before the code tries to open it, and
alerting the user if it cannot be found (and, again, perhaps asking for user assistance). Error handling is as much art
as science, and to get good at it you must "think like a user" ... you can bet users aren't going to do processes the
same way you do. Believe me, when you launch your app for the first time you'll end up getting reports of some of the
oddest things that users are doing ... <g>
Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com