How do I capture the access vba sub/function name at runtime?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using Access 2003. I would like to setup an error logging routine and
in that routine, I want to log to subroutine or function name that caused the
error. Is that data available at runtime?
 
vince6501 said:
I am using Access 2003. I would like to setup an error logging routine and
in that routine, I want to log to subroutine or function name that caused the
error. Is that data available at runtime?


Regretably, it is not.

The usual approach is for each procedure to identify itself
via an argument to the general logging sub.
 
I would suggest you call the logging routine from your normal error handling
routines and pass it the name of the procedure and maybe the error number:

Err_cmdSomeButton_Click:
Call ErroLogger(Me.Name, "cmdSomeButton_Click", Err.Number)
 
Yes, that is what I am doing, but I was hoping that there was a better (more
general) way. Thanks for you reply.
 
Try the application.CodeContextObject Property
rgds gabor

„vince6501†ezt írta:
 
Hey, I looked up CodeContextObject in vb help and it works great! Thank you!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top