KernelK
Registered User.
- Local time
- Today, 13:00
- Joined
- Oct 3, 2006
- Messages
- 173
Hey everyone,
I am trying to run a procedure by using a string value containing it's name. From all of the help files, the Run method is the way to go. However, when testing with it, I cannot make it work. I have the following code on a form that I am testing the method with:
When I click the button on the form, I get the following error: "Run-time error '2517': VSD Ticket Tracking can't find the procedure 'MessageMod.'"
I have also tried appending the form name before the procedure with the same error returned:
What am I doing wrong here? It does not make any sense to me at this point.
I am trying to run a procedure by using a string value containing it's name. From all of the help files, the Run method is the way to go. However, when testing with it, I cannot make it work. I have the following code on a form that I am testing the method with:
Code:
Option Compare Database
Option Explicit
Private Sub Command0_Click()
Call TestMod("MessageMod")
End Sub
Sub TestMod(strMod As String)
Application.Run strMod
End Sub
Sub MessageMod()
MsgBox "TESTING"
End Sub
When I click the button on the form, I get the following error: "Run-time error '2517': VSD Ticket Tracking can't find the procedure 'MessageMod.'"
I have also tried appending the form name before the procedure with the same error returned:
Code:
Private Sub Command0_Click()
Call TestMod("Form1.MessageMod")
End Sub
What am I doing wrong here? It does not make any sense to me at this point.