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

  • Thread starter Thread starter Kathy Burke
  • Start date Start date
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
 
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)"
 
Back
Top