Re: Convert string to form
This is Bruno solution to this matter.
Use Add method of Forms collection:
Forms.Add("Form1").Show
You'll need VB6 SP3 for Forms.Add to work. Without SP3 it won't work when compiled.
option Explicit
private Sub Form_Click()
Dim x as Form, strName as string
strName = "Form1"
set x = Forms.Add(strName)
x.Show
End Sub
Hope it help you too
Cesare Imperiali
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
Re: Convert string to form
Well, I am running VB6 with SP4 and I can't get ths Forms.Add to work. I get error 424, object required. Any hints to make this work?
Re: Convert string to form
Never mind. I had something typed wrong. That works great. Thanks so much!!!!
Re: Convert string to form
Thanks to Bruno (we will miss him).
Best regards,
Cesare Imperiali
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
Re: Convert string to form
Dear Cimperiali
thank u very much, it work properly
Deepak