Error handling with function, not possible?

hbrems

has no clue...
Local time
Today, 02:18
Joined
Nov 2, 2006
Messages
181
Dear all,

I'm trying to add a logging function to my error handling but this seems not possible.

Code:
On error goto errorcheck

...some code...

exitnice:
     exit sub

errorcheck:
     defineerror ' log error details to textfile
     resume exitnice

Error message: expected variable or procedure, not module... So is this really not possible (in Access 2003) and if so, is there an easy way around this? I don't want to write the same stuff for each procedure.
 
You haven't given us the code for

defineerror

So where do you have the code for defineerror? Is it in a standard module?
 
Hi Bob,

defineerror is a function that appends some text to a textfile. It is located in a standard module.

Kind regards
 
Are you sure that you didn't name the module that the defineerror function is in the same name? The error sounds like you named both the module and the function the same name.
 
Hi Bob,

just checked: this is indeed the case. I'm a bit embarassed now... :-/

Kind regards
 
Hi Bob,

just checked: this is indeed the case. I'm a bit embarassed now... :-/

Kind regards
Hey, don't worry about it. I think it's happened to all of us at one time or another. How do you think I suspected it :D :o ;)
 

Users who are viewing this thread

Back
Top Bottom