Passing values of variables to custom error handler (1 Viewer)

BiigJiim

Registered User.
Local time
Today, 20:47
Joined
Jun 7, 2012
Messages
114
Hi,

I have read a very good article on error handling from FMS here. However I would like to know if it is possible to pass and store the values of any variables in use at the point where the code crashed (i.e. similar to looking at the Locals window.) Surely this would be extremely helpful in determining the cause of an error?

Any help or pointers greatly appreciated!
Jim
 

theDBguy

I’m here to help
Staff member
Local time
Today, 12:47
Joined
Oct 29, 2018
Messages
21,476
Hi Jim. I don't see why not. What have you tried?
 

BiigJiim

Registered User.
Local time
Today, 20:47
Joined
Jun 7, 2012
Messages
114
Hi Jim. I don't see why not. What have you tried?

Hi DBguy,

I am trying to write a custom error handler to put into an existing application. I am using something similar to PushCallStack and PopCallStack (see FMS article) so the error handler stores the procedure name, but is there any way that my code can access the info from the Locals window (ie get every variable value in scope) without having to explicitly state each variable in each procedure when the error handler is called?
 

jdraw

Super Moderator
Staff member
Local time
Today, 15:47
Joined
Jan 23, 2006
Messages
15,379
FYI, Wayne Phillips has a download vbWatchdog at https://www.everythingaccess.com/downloads.asp
It may be relevant to your situation, unless your intent on building your own. I do not use the code, but am aware of its existence. I use the "insert error handler" of MZToolsforVBA.
 

BiigJiim

Registered User.
Local time
Today, 20:47
Joined
Jun 7, 2012
Messages
114
FYI, Wayne Phillips has a download vbWatchdog at https://www.everythingaccess.com/downloads.asp
It may be relevant to your situation, unless your intent on building your own. I do not use the code, but am aware of its existence. I use the "insert error handler" of MZToolsforVBA.

Thanks for the tip. I am not sure we can use a 3rd party product for this project, but it certainly looks a pretty smart bit of software, if a little complex!
 

jdraw

Super Moderator
Staff member
Local time
Today, 15:47
Joined
Jan 23, 2006
Messages
15,379
Jim,

I watch a lot of videos by Paul Kelly. Here's a link to some error handling facts and samples. He is an Excel guru, but much of what he describes seems applicable to Access. You may get some ideas/insight from the material. An interesting project ---good luck.
 

Users who are viewing this thread

Top Bottom