[AccessD] Call Stack in VBA?

Charlotte Foust cfoust at infostatsystems.com
Thu Jul 24 10:17:41 CDT 2008


I don't know if you can get at the actual call stack, but you can use
"push"  methods to write a line to a collection, an xmlfile or even a
straight text file and "pop" methods to remove the line after the call
successfully executes.  An error would result in the "pop" not being
executed, giving you a list of steps that got you to the error.  I used
to do this years ago based on an article written for A97 (I think) that
I adapted to my own uses.  I created a CallStack class with push and pop
methods, but it took a lot of work to pass the name of each routine into
the stack since Access didn't give a simple method for retrieving the
name of the procedure.  I finally used a local constant, procName, in
each routine and populated it when I built the routine.  

Actually, searching back through my archives, I find that Lambert posted
a clsStack, which uses a collection, ages ago as well, so you might root
through the archives for more.

Charlotte Foust

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller
Sent: Thursday, July 24, 2008 7:47 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Call Stack in VBA?

What a great idea! I hope someone has your answer. You're right, it
would be incredibly useful.

On Thu, Jul 24, 2008 at 8:56 AM, Dan Waters <dwaters at usinternet.com>
wrote:

> Is there a way to use VBA to record the call stack?  In my error 
> trapping routine, this would be incredibly helpful.
>
> Thanks!
> Dan
>
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list