PC Review


Reply
Thread Tools Rate Thread

Calling another subroutine

 
 
sck10
Guest
Posts: n/a
 
      15th Aug 2005
Hello,

How do you reference a sub that uses CommandEventArgs from another sub? For
example, I would like to call the sub "EmployeeOld_Click" from "Call_MySub".

Sub Call_MySub()
Call EmployeeOld_Click(Something here, Something here)
End Sub


Sub EmployeeOld_Click(ByVal Src As Object, ByVal Args As CommandEventArgs)
Me.pnlEmployeeNew.Visible = True
End Sub

--
Thanks in advance,

sck10


 
Reply With Quote
 
 
 
 
Andrea Zani
Guest
Posts: n/a
 
      15th Aug 2005
sck10 <(E-Mail Removed)> ha scritto:
> How do you reference a sub that uses CommandEventArgs from another
> sub? For example, I would like to call the sub "EmployeeOld_Click"
> from "Call_MySub".
>
> Sub Call_MySub()
> Call EmployeeOld_Click(Something here, Something here)
> End Sub
>
>
> Sub EmployeeOld_Click(ByVal Src As Object, ByVal Args As
> CommandEventArgs) Me.pnlEmployeeNew.Visible = True
> End Sub


Sub Call_MySub()
EmployeeOld_Click(nothing,nothing)
End Sub

--
AZ [Microsoft - .NET MVP]
Mia Home page: http://ciclismo.sitiasp.it
Asp.Net community: http://www.aspitalia.com
Il mio blog: http://blogs.aspitalia.com/az


 
Reply With Quote
 
billrob458
Guest
Posts: n/a
 
      15th Aug 2005
Since it appears you are not using the CommandEventArgs parameter in
your EmployeeOld_Click method, you can call it passing empty
parameters.

Sub Call_MySub()
EmployeeOld_Click Nothing, EventArgs.Empty
End Sub

HTH,

bill

sck10 wrote:
> Hello,
>
> How do you reference a sub that uses CommandEventArgs from another sub? For
> example, I would like to call the sub "EmployeeOld_Click" from "Call_MySub".
>
> Sub Call_MySub()
> Call EmployeeOld_Click(Something here, Something here)
> End Sub
>
>
> Sub EmployeeOld_Click(ByVal Src As Object, ByVal Args As CommandEventArgs)
> Me.pnlEmployeeNew.Visible = True
> End Sub
>
> --
> Thanks in advance,
>
> sck10


 
Reply With Quote
 
=?Utf-8?B?U3JlZWppdGggUmFt?=
Guest
Posts: n/a
 
      15th Aug 2005
it would be cleaner to move the code within EmployeeOld_Click to a common
function and call the common funtion from both EmployeeOld_Click and
Call_MySub... my 0.02$

"sck10" wrote:

> Hello,
>
> How do you reference a sub that uses CommandEventArgs from another sub? For
> example, I would like to call the sub "EmployeeOld_Click" from "Call_MySub".
>
> Sub Call_MySub()
> Call EmployeeOld_Click(Something here, Something here)
> End Sub
>
>
> Sub EmployeeOld_Click(ByVal Src As Object, ByVal Args As CommandEventArgs)
> Me.pnlEmployeeNew.Visible = True
> End Sub
>
> --
> Thanks in advance,
>
> sck10
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling a subroutine - how to? Roger on Excel Microsoft Excel Programming 4 8th Dec 2009 03:59 AM
Calling VBA subroutine from a query? DavidY Microsoft Access Queries 7 11th Aug 2008 01:47 PM
Calling a Subroutine Sash Microsoft Access VBA Modules 9 18th Mar 2008 04:36 PM
calling subroutine Lodewijk Microsoft Access Form Coding 1 29th Mar 2005 07:31 AM
Calling a DLL subroutine =?Utf-8?B?TWFyaWFubmU=?= Microsoft VB .NET 2 15th Oct 2004 12:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:15 PM.