Link to home
Start Free TrialLog in
Avatar of ocsurf
ocsurf

asked on

ActiveMdiChild - call current class function

I have 4 windows forms : frmMain - set to mdicontainer
frm1,frm2 and frm3 (all 3 have the same function save(), update(), delete(); but the code is different for all)
---CODE---------------------------------
' not full code, just example
Public Class frmMain
      Dim doc As Form
      sub frm1_Click()
        If Not Me.ActiveMdiChild Is Nothing Then
            ActiveMdiChild.Close()
        End If
            doc = New frm1
        doc.MdiParent = Me
        doc.Show()            
      end sub
      sub frm2_Click()
        If Not Me.ActiveMdiChild Is Nothing Then
            ActiveMdiChild.Close()
        End If
            doc = New frm2
        doc.MdiParent = Me
        doc.Show()      
      end sub      
      sub frm3_Click()
        If Not Me.ActiveMdiChild Is Nothing Then
            ActiveMdiChild.Close()
        End If
            doc = New frm3
        doc.MdiParent = Me
        doc.Show()      
      end sub            
      sub save()
            'should call the current class's save function
            doc.save()  <--- Error "save() is not a member of 'System.Windows.Forms.Form'
      end sub            
end class
------------------------------------
Any help?
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America 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
oops...

"vave" should be "save"

=)