daniel_j_c
asked on
createobject to instance a vb6 form?
Hi
Is there any way to instance a vb6 form using only the name of the form in vb6?
eg: set frm = createobject("form1")
(this doesn't work)
I want to be able to instance a form from it's name which will be stored in a string.
Is there any way to instance a vb6 form using only the name of the form in vb6?
eg: set frm = createobject("form1")
(this doesn't work)
I want to be able to instance a form from it's name which will be stored in a string.
ASKER
ok, here's a little background...
I want to be able to store the names of forms in a database in a "tasks" table. The tasks table has the name of the form to be instanced and an associated task name eg:
Form Task Name
frmclientdetails New Client
I want to be able to create an instance of the form frmclientdetails using the string "frmclientdetails". I can't use "= new frmclientdetails" because that would require me to create a select case statement like this:
select case FormName
case "frmclientdetails": set frm=new frmclient details
...
end select
Which is why I want to use something like createobject().
I want to be able to store the names of forms in a database in a "tasks" table. The tasks table has the name of the form to be instanced and an associated task name eg:
Form Task Name
frmclientdetails New Client
I want to be able to create an instance of the form frmclientdetails using the string "frmclientdetails". I can't use "= new frmclientdetails" because that would require me to create a select case statement like this:
select case FormName
case "frmclientdetails": set frm=new frmclient details
...
end select
Which is why I want to use something like createobject().
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
can't believe it's that simple! i've been looking for something like this for years!
dim frm as form1
set frm = new form1
...