473,327 Members | 2,007 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Calling another subroutine

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
Nov 19 '05 #1
3 1016
sck10 <sc***@online.nospam> 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
Nov 19 '05 #2
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


Nov 19 '05 #3
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

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Michael Farber | last post by:
Not sure if this is the right group for this but anyways... I've got an ASP web application that uses a Visual Basic component to do some work. I instantiate the component in asp and then...
2
by: Giulio Belrango | last post by:
Hi I need someones help I'm working in an IBM 390 batch environment. What I'm trying to do is to call from a non DB2 COBOL program a DB2 COBOL program that will access a table and perform an...
30
by: Tim Marshall | last post by:
Here's the scenario, A2003, Jet back end, illustrated with some cut down code at the end of the post: A proc dims a snapshot recordset (dim rst as Dao.recordset) and opens it. There are several...
5
by: Amit | last post by:
I tried calling a subroutine in a fortran module from C ,but couldn't.I always get the error: undefined reference in the main.o file (main is in C calling the subroutine). for calling the...
2
by: singlal | last post by:
Hi, my question was not getting any attention because it moved to 2nd page; so posting it again. Sorry for any inconvenience but I need to get it resolved fast. Need your help! ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.