Run sub procedure -- "expression expected" ???

K

Kathy Burke

Hi again,

I'm trying to run a sub from within another:

Public Sub txtScan_TextChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
txtScan.TextChanged

ProcessSN(ByVal sender As System.Object, ByVal e As
System.EventArgs)

End Sub

ByVal is indicating "expression expected". What is the correct way to
run a sub from another?

Thanks.
Kathy
 
K

KD

Hi Kathy!
The ProcessSN procedure seems to be an event handler of
some sort.
I would guess that it would be the solution for you to
move whatever code you have in that procedure to a
separate procedure. Then call the new procedure from both
the txtScan_TextChanged and ProcessN event handling
procedure.
Finally if you want to call another procedure you just
use the procedurename and send in the necessary datatypes.
Ex: "SomeProc(MyObject, strValue)" would be a correct way
to call "private SomeProc(ByVal SomeObj As Object, ByVal
SomeStr As String)"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,132
Latest member
TeresaWcq1
Top