Is it possible to load using a formname in a string variable
For eg.,
<vbcode>
strFormName = "Form1"
Load strFormName
</vbcode>
Please send me a solution for this !!
Printable View
Is it possible to load using a formname in a string variable
For eg.,
<vbcode>
strFormName = "Form1"
Load strFormName
</vbcode>
Please send me a solution for this !!
Here it is. Without SP3 for VB6, it won't work when compiled.
private Sub Form_Click()
Dim x as Form
set x = Forms.Add("Form2")
x.Show
End Sub
' or
private Sub Form_Click()
Forms.Add("Form2").Show
End Sub
' or
private Sub Form_Click()
Dim x as Form
set x = CallByName(Forms, "Add", VbMethod, "Form2")
x.Show
End Sub