B
Brian
Is there a way to recall a procedure name from a variable?
I am developing an app that has a table of clients, with different code to
be run, depending on the client. I loop through the Client table, and
depending on the client, run a different procedure because the things that
need to be done are very different for each client.
Rather than calling the procedure from within a Select Case on
Client.ClientID, I would like to have a field in the Client table called
ProcedureName. Then, when I run my code, I would like to look up the value of
this field for the specific client and call that procedure.
Although it was already obvious it would not work this way, I tried it and
got the expected Compile error:
Private Sub Test
Dim ProcName As String
ProcName = "DoThis"
Call ProcName 'got the error here
End Sub
Private Sub DoThis
DoThingsHere
End Sub
I am developing an app that has a table of clients, with different code to
be run, depending on the client. I loop through the Client table, and
depending on the client, run a different procedure because the things that
need to be done are very different for each client.
Rather than calling the procedure from within a Select Case on
Client.ClientID, I would like to have a field in the Client table called
ProcedureName. Then, when I run my code, I would like to look up the value of
this field for the specific client and call that procedure.
Although it was already obvious it would not work this way, I tried it and
got the expected Compile error:
Private Sub Test
Dim ProcName As String
ProcName = "DoThis"
Call ProcName 'got the error here
End Sub
Private Sub DoThis
DoThingsHere
End Sub