"Bas Cost Budde" wrote
. . . But you have to include the On Error
statement in every procedure that may some
day cause a run time error. In daily speak,
that's every procedure.
However, if you consistently use a Code Library, almost all of them provide
for a "skeleton structure" for procedures which can include some basic error
handling. A commercial product of this kind is FMS, Inc.'s Total Visual Code
Tools for Access 2003, and other recent versions...
http://www.fmsinc.com/products. MVP Arvin Meyer has a free tool called
CodeWriter2 at his site,
http://www.datastrat.com/DataStrat2.html, which I
have used for the same purpose.
Also, twice in my career, I have been called upon to write code to add basic
error handling to rather extensive databases, one was an Access 2.0 MDB and
the other was an Access 2000 ADP. It worked both times, with a lot less
manual "fixup" than I had anticipated. Both were complicated by the fact
that there is some error handling in code generated by Wizards -- that has
to be taken into account.
I couldn't post the code even if I had a copy, because it belongs to the
client in each case. They were interesting projects, separated by almost ten
years of time. I guess I should have made agreement with the first client to
retain rights and kept a copy of the code to use as a starting point, eh? As
the first client has discarded the Access 2.0 application, even they would
not have that code. There's probably no one there who even remembers that
kind of detail about the application, and maybe no one who remembers the
application at all.
Larry Linson
Microsoft Access MVP