Calling a sub or function

  • Thread starter Thread starter Junior
  • Start date Start date
J

Junior

I have a sub Sub2 that is now behind the click event on a form's command
button. cmd2
I want to run sub2 from a line in Sub1 - sub1 is activated by a click event
on cmd1.
i.e. i would like to run all of the code by pressing cmd1
i know i can insert the sub2 code into sub1- but it is long- and i'd like to
learn how to call a sub or function from another sub.
So can someone give me some tips-help
 
Junior said:
I have a sub Sub2 that is now behind the click event on a form's command
button. cmd2
I want to run sub2 from a line in Sub1 - sub1 is activated by a click event
on cmd1.
i.e. i would like to run all of the code by pressing cmd1
i know i can insert the sub2 code into sub1- but it is long- and i'd like to
learn how to call a sub or function from another sub.


Just call sub2 from the code in sub1.

Sub2 arglist
or
Call Sub2(arglist)
 
Back
Top