Hi..
How to call this Statement using ScriptControl.
"Load FrmTest"
Regards
Soundar
Note: this problem can also be solved using Forms Collection. My intension is how to use the ScriptControl for this Statement.
Printable View
Hi..
How to call this Statement using ScriptControl.
"Load FrmTest"
Regards
Soundar
Note: this problem can also be solved using Forms Collection. My intension is how to use the ScriptControl for this Statement.
Make a reference in your project to. . .
Microsoft Script Control
Code:Private Sub Form_Load()
Dim objScript As ScriptControl
Dim sScriptCode As String
Set objScript = New ScriptControl
sScriptCode = "Sub FrmTest" & vbCrLf
sScriptCode = sScriptCode & "MsgBox " & Chr$(34) & "Hello World" & Chr$(34) & vbCrLf
sScriptCode = sScriptCode & "End Sub"
Debug.Print sScriptCode
With objScript
.Language = "VBScript"
.AddCode "Option Explicit" & vbCrLf & sScriptCode
.Run "FrmTest"
End With
Set objScript = Nothing
End Sub
Hi DinoVaught ,
Thank you for the Response.
But. ...... ! Let me tell you my actual requirement which I missed to do in the earlier...
In my application i have planned to have a shortcut toolbar which is dynamically created by each user (like creating the shortcut in Windows).
So, i can dynamically created command button based on the User choice. now i have to call that form which is exist in the Application.
And iam storing the Form Name in the database as a string dataType.
Hope this explanation would clearly mean what iam expecting..
Awaiting for your reply..... Thank You !