views:

692

answers:

2

Would It be possible to see Stack in VBA (MS Access 2003). I mean Would it be possible to see what procedure or function this function was called from...

+4  A: 

At runtime, View menu -> Call Stack (or press CTRL + L).

shahkalpesh
+1  A: 

There is no programmatic way in VBA to view the call stack that I know of. The usual solution to this problem is to use some structure to track calling of functions, but it always seems like a kludge to me, and really of use only when programming (not at runtime), in which case it seems to me that the VBE's built-in capability for seeing the call stack is sufficient.

And, BTW, I always put the call stack button on my VBE toolbar, since it's one of the most frequently used functions for me. I also add the compile button -- I think it's crazy that it's not on the toolbar by default because it encourages people to code without ever forcing a compile. Then again, Access 2000 didn't even use Option Explicit by default (supposedly for consistency with the other apps using the VBE -- in other words, dumb down Access in order to make it consistence with apps that aren't nearly as code-heavy).

But I digress...

David-W-Fenton