The only way I would know to do this is to always call ReCalculateTotals with a "CalledFrom" parameter where the calling function basically identifies itself to ReCalculateTotals. Then when the error occurs, you can check the value of CalledFrom. Of course this would mean going back and adding code everywhere you cal ReCalculateTotals from, not worth it unless you want to use the functionality in the future.
A similar idea would be to to a Debug.Print "Calling ReCalculateTotals from xxx" wherever you call ReCalculateTotals and then just watch your Debug window to see which "parent" function called it last when error occurs. Actually, you may able to look at the Call Stack (Ctrl-L) when the error occurs to figure out what you need to know. HTH, Toby ----- Original Message ----- From: "vjcross2004" <[EMAIL PROTECTED]> To: <AccessDevelopers@yahoogroups.com> Sent: Wednesday, November 16, 2005 2:13 PM Subject: [AccessDevelopers] How to find calling code? > I have an error log which records username, timedate, activeform name, > functionname & error message/number when an error message is displayed > to the user. > > I know which function the error is occuring in (ReCalculateTotals), > but I don't know where it is being called from. Recalculate totals is > called from all over my database with various parameters. > > I could go through them all to try to find which call is causing the > error, but it would be a lot simpler if there were some way of > determining the 'parent' function, ie the calling function from within > the function. > > Does anyone know if there's some global variable etc, or has anyone > any alternative suggestions? > > Thanks > Jane > > > > > > > > Please zip all files prior to uploading to Files section. > Yahoo! Groups Links > > > > > > ------------------------ Yahoo! Groups Sponsor --------------------~--> Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/q7folB/TM --------------------------------------------------------------------~-> Please zip all files prior to uploading to Files section. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AccessDevelopers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/