Calling Subprocedures

  • Thread starter Thread starter craig via DotNetMonster.com
  • Start date Start date
C

craig via DotNetMonster.com

I'm sure there is a simple answer, but I just can't get my head around this
today. I have various Sub's that each generate a specific report. I have
the Sub's name in a variable. Other than testing the contents of the
variable for each name like:

If ProcName="FaceSheet" Then
FaceSheet()
ElseIf ProcName="ProgNote" then
ProgNote().............

Is there a way that I can make the call to the Sub using the contents of the
variable?

Thanks,
Craig
 
Craig,

If your code is structured in such a way that you can take advantage of it,
the CallByName function is by far the easiest way to call methods (subs) by
name.

Kerry Moorman
 
great variation theme of alter goto from COBOL!
Kerry Moorman said:
Craig,

If your code is structured in such a way that you can take advantage of it,
the CallByName function is by far the easiest way to call methods (subs) by
name.

Kerry Moorman
 
Back
Top