Changing the default sub template

Satal Keto

Registered User.
Local time
Today, 04:20
Joined
Jan 30, 2008
Messages
27
What I am trying to find out is whether it is possible to change the default template for sub's.
What I mean by this is that in every function I create I put in some standard error handling code and I was wondering whether it is possible to change the templates for subs to automatically put that error handling code in.

So for example when you first start a sub for Form_Load it looks like this.
Code:
Private Sub Form_Load()

End Sub

but instead of that appearing automatically I would like for it to automatically appear as

Code:
Private Sub Form_Load()
On Error GoTo Err_Form_Load



Exit_Form_Load:
    Exit Sub

Err_Form_Load:
    MsgBox err.Description, , "Error"
    Resume Exit_Form_Load
End Sub

Obviously I understand that if there is a way to change the default template that it would mean that I would have to go through and change the default template for every different sub for every different control, but at the end of the day it would save more time than it would take to make those changes.

If it is not possible to change the default templates is it possible to achieve this effect in any other way?

Thanks for any help in advance
Satal :D
 
Can't be done. These defaults reside in a part of Access which can't be changed.
Use the tool MZTools instead or write your own.
I am talking about Acc2003 and earlier Acc2007 dont know.
HTH:D
 

Users who are viewing this thread

Back
Top Bottom