Determine Calling Function

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

Guest

Is there a way, through code, to determine who or what called a specific
function? For instance you have Function A that calls Function B or you have
Macro C that call Function B. Is there some code that would reside in
Function B that could determine that it was called by Function A or Macro C?

Thanks.
 
Unfortunately, no such functionality exists in Access. You could always pass
an extra argument providing that information to function B.
 
Just add an argument to Function B that each caller passes. Each caller
should pass a value that would identify it.

Public Function B(lngWhoCalled, OtherStuff) As String

Select Case lngWhoCalled
Case 0
MsgBox("A Called")
Case 1
MsgBox("B Called")
Case 2
Msgbox("You Mom Called")
End Select
 
Back
Top