Link to home
Start Free TrialLog in
Avatar of JamesAnthony
JamesAnthonyFlag for Ireland

asked on

Dim a Form

Hi all
Have this code

        Dim NewMDIChild As New MyWorkingForm
        NewMDIChild.MdiParent = AMPSMDI2010
        NewMDIChild.Show()

Where myWorkingform is a form in my project and it works

BUT

I want to do this, should be simple but getting lost


    Dim gForm As New Form
        gForm = "MyworkingForm"

 (Where the "MyWorkingForm" is a passes String rather that a form in the project)


        Dim NewMDIChild As New  gform
        NewMDIChild.MdiParent = AMPSMDI2010
        NewMDIChild.Show()
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Presuming VB6, you can try this:

        Dim f As Form
        set f = CreateObject("MyworkingForm")
        CallByName(f, "MdiParent", vbSet, AMPSMDI2010)
        f.Show 

Open in new window

in VB 2008 you can just call the form directly from another form.

with gform
.mdiparent=AMPSMDI2010
.show
end with
ASKER CERTIFIED SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JamesAnthony

ASKER

Got me on the right road, wasn't the complete solution,
But
Thanks