call a sub using a variable

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I need to change which subroutine I call based on the user's input. Can I
save the name of the Sub in a variable? So far I've tried:

Dim MySub as string
MySub = "sLoadSNData"
Call MySub

No surprise this complains that "expected procedure, not variable". So
what's the syntax or best way to dynamically vary the subroutine called?
Thanks so much!
--
sam
.



Relevant Pages

  • Re: call a sub using a variable
    ... > I need to change which subroutine I call based on the user's input. ... > Can I save the name of the Sub in a variable? ... > Dim MySub as string ... Please reply to the newsgroup so all may benefit. ...
    (microsoft.public.access.modulesdaovba)
  • Re: idiom for managing passed arguments?
    ... > sub wanted ... Perl being Perl, there are several idiomatic ways to pass arguments to ... subroutine call and you can leave them out of the call. ... Prev by Date: ...
    (comp.lang.perl.misc)
  • Re: calling subroutine , name derived from variable
    ... > I want to call subroutine, but the name of the subroutine itself is in a ... sub this_sub { ... It's better practice to use a hash as you won't break the strictures pragma ... Prev by Date: ...
    (comp.lang.perl.misc)
  • Cursor Values and Subroutines
    ... Normally I can easily return the string from a sub routinge, ... from another subroutine, ... Prev by Date: ...
    (perl.dbi.users)
  • Re: calling subroutine , name derived from variable
    ... >> I want to call subroutine, but the name of the subroutine itself is in a ... > You're looking for symbolic references, but it's not good practice to use ... > sub this_sub { ... Prev by Date: ...
    (comp.lang.perl.misc)