Error trapping vs code bloat?

zim_ulator

Registered User.
Local time
Today, 10:57
Joined
Dec 7, 2004
Messages
12
Does anyone feel that this really basic error trapping code

Exit_btnEditRecord_Click:
Exit Sub

Err_btnEditRecord_Click:
MsgBox Err.Description
Resume Exit_btnEditRecord_Click


(which I believe Access pops in by default when using those "wizardy" thingies. ) are nessesary? If all I'm doing is calling a sub, with all the heavy lifting in a module, would it be prudent to take out the error stuff in the click event code, while error trapping code is executed in the module's code?

zim
invading an earth near you
 
It could be helpful if something happened to the sub you're calling. Like if it was accidentally deleted or renamed.

And another reason is that it encourages good coding habits like naming conventions, etc. Just one less thing to worry about, put it in all mods / subs and ponder more important issues.

Just my thoughts...
kh
 
KenHigg said:
It could be helpful if something happened to the sub you're calling. Like if it was accidentally deleted or renamed...

Ken,

Thanks for your response. I'm looking into better ways to handle errors than the default behavior, and there's lots of material here to draw from.
 
Zim, you need to take a broader view.

I ALWAYS use the code built by the wizard. I just don't leave it alone. I start from where it leaves off. Then I customize the crap out of it.
 
_doc_

I'm uncertain about what you mean by broader view. As for wizards, I am using them here and there, but less frequently as I learn more about Access and VB. I'm thinking about adapting wizards to my own preferences. There's a cool addin called V-Tools; it's got a quick way to create and apply form templates. I'd use anything which saves me time, as long as I understand how it works, and inasmuch as it promotes good programming practices.

Denis
up late invading last night,
your planet is safe today
 

Users who are viewing this thread

Back
Top Bottom