|
-
September 15th, 2003, 05:19 AM
#1
How to Call this Statement ???
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.
your's
Soundar
-
September 15th, 2003, 01:51 PM
#2
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
Last edited by DinoVaught; September 15th, 2003 at 03:02 PM.
-
September 15th, 2003, 11:23 PM
#3
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 !
your's
Soundar
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|