-
Execute Statement ????
Hello,
In VB we have this Statement running
Dim lvFrm as Form
Set lvFrm = FrmTest
msgbox lvFrm.Caption
if the Statement "Set lvFrm = FrmTest" is a STRING then how could we execute ? Using Script Control.
My aim is to Load a form using a String Statement.
I tried ScriptControl.ExecuteStatement "Load FrmTest"
An Error Popups " Typemismatch: 'Load' "
Any Solution.......
Thank you
Regards
Soundar
-
I'm not sure if it is exactly what you are looking for, but check into the CallByName() function.
-
Execute Statement
hi.
I want to execute a String Statement "Load FrmTest" .. to Load a Form .
(FrmTest -> is a Form)
How do I call this Using Script Control..
Regards
Soundar
-
Take a look
http://www.codeguru.com/forum/showth...hreadid=205597
is in the sticky item: VB frequently asked questions.
I hope is what you need.
Jaime
-
Error Occurs
Hi,
Here the FormName is in String : its shows
Object Required : XYZ (FormName)
Or else how to Convert the String to Object ?? :eek:
Soundar
-
Hi Dear
Please try this.
Set the Project Reference to Microsoft Script Control 1.0 from Project ->References
General Declaration Section
---------------------------------
Option Explicit
Dim scpt As ScriptControl
Dim frmMain
Form Load Event
----------------------
Set scpt = New ScriptControl
With scpt
.Language = "VBScript"
.AddObject "frmMain", Form2
End With
Command Button Click Event
------------------------------------
scpt.ExecuteStatement " MsgBox frmMain.Caption"
-
Still......
Hi... samitanveer
In your Code.. Form2 is an Object...
Consider if that is being a String ????
Reply me... I am Awaiting.....
Soundar
-
Hi bsoundar,
Another way to load the form is by adding it into VB.Forms collection, this is much simplier.
Code:
VB.Forms.Add "Form2"
Have a nice day:)
-
Thank You & to All
IT WORKS ! IT WORKS !! AND IT WORKS !!!!
Thanks A lot ....... " Thread1 "
and to all the members who atleast tried to give solutions...
Regards
Soundar