Hi, I'm using VB.Net (2003) and I have a question. Does anyone knows
how to call a procedure using a variable? The variable will be equal to
the name of the procedure.
for example, if I have the following variable:
Public PrintTheSub as string
and the following subs:
Private Sub PrintOrdersRepo rts ()
' the code for this sub goes here
End Sub
Private Sub PrintCustomerRe ports()
' the code for this sub goes here
End Sub
Private Sub PrintMonthlyRep ort()
' the code for this sub goes here
End Sub
and I have a button with the public variable in it:
Private Sub btnPrint_Click( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnPrint.Click
' here will go the variable that will call one of the 3 subs.
PrintTheSub
End Sub
And during the process but before getting to the print button, the
PrintTheSub variable = "PrintCustomerR eports"
How can I make the print button to accept the variable value and when
clicked it could call the PrintCustomerRe ports sub?
Any help would be appreciated.
how to call a procedure using a variable? The variable will be equal to
the name of the procedure.
for example, if I have the following variable:
Public PrintTheSub as string
and the following subs:
Private Sub PrintOrdersRepo rts ()
' the code for this sub goes here
End Sub
Private Sub PrintCustomerRe ports()
' the code for this sub goes here
End Sub
Private Sub PrintMonthlyRep ort()
' the code for this sub goes here
End Sub
and I have a button with the public variable in it:
Private Sub btnPrint_Click( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnPrint.Click
' here will go the variable that will call one of the 3 subs.
PrintTheSub
End Sub
And during the process but before getting to the print button, the
PrintTheSub variable = "PrintCustomerR eports"
How can I make the print button to accept the variable value and when
clicked it could call the PrintCustomerRe ports sub?
Any help would be appreciated.
Comment