|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Calling Subprocedurestoday. 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 -- Message posted via DotNetMonster.com http://www.dotnetmonster.com/Uwe/Forums.aspx/dotnet-vb-net/200609/1 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 Show quoteHide quote "craig via DotNetMonster.com" wrote: > 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 > > -- > Message posted via DotNetMonster.com > http://www.dotnetmonster.com/Uwe/Forums.aspx/dotnet-vb-net/200609/1 > > great variation theme of alter goto from COBOL!
Show quoteHide quote "Kerry Moorman" <KerryMoor***@discussions.microsoft.com> wrote in message news:533AA298-52A1-42AC-BAC3-64A6F51ED36D@microsoft.com... > 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 > > > "craig via DotNetMonster.com" wrote: > > > 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 > > > > -- > > Message posted via DotNetMonster.com > > http://www.dotnetmonster.com/Uwe/Forums.aspx/dotnet-vb-net/200609/1 > > > >
Problem calling a Sub in another form
WebBrowser - Excel processs till running Random Numbers Not Being Random Why is PeekChar causing a problem? passing parms to sql stored procedure Image list controls and image resources Q: Copying part of a table Write commands to the COM port Question in re LIKE in VB 2005 Refresh/Blinking Problems with VB.NET Application |
|||||||||||||||||||||||