binita11
asked on
Open form by variable
Hi
do u have any idea to open a form dynamically by putting the form name in some variable and open the form using that variable.
eg.
dim x as variable
x.show 'must open the form whose name is stored by x
thanks
do u have any idea to open a form dynamically by putting the form name in some variable and open the form using that variable.
eg.
dim x as variable
x.show 'must open the form whose name is stored by x
thanks
Assuming VB6:
Private Sub Command1_Click()
Dim frmName As String
frmName = "Form2"
Dim frm As Form
Set frm = Forms.Add(frmName)
frm.Show
End Sub
Private Sub Command1_Click()
Dim frmName As String
frmName = "Form2"
Dim frm As Form
Set frm = Forms.Add(frmName)
frm.Show
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
then you can say this:
Dim newForm as frmUSerInput
and later on
set newform = new frmUserInput
newform.show vbmodal and so on.
HTH