Click Materials Invoice -> Materials Invoice Form Show -> Materials Invoice Form Close -> Click Requisition Materials -> Requisition Materials Form Show -> Click Materials Invoice -> Materials Invoice Form Show Code (VBScript)
Private Sub TreeView1_AfterSelect(sender As Object, e As TreeViewEventArgs) Handles TreeView1.AfterSelect
Select Case TreeView1.SelectedNode.Name
Case Is = "matinv"
If Application.OpenForms().OfType(Of matinv).Any Then
Else
Dim status As New matinv
status.MdiParent = Me
status.Show()
status.Location = New Point(0, 0)
End If
Case Is = "req"
If Application.OpenForms().OfType(Of requisition).Any Then
Else
Dim status As New requisition
status.MdiParent = Me
status.Show()
status.Location = New Point(0, 0)
End If
Case Is = "viewStock"
If Application.OpenForms().OfType(Of stockremain).Any Then
Else
Dim status As New stockremain
status.MdiParent = Me
status.Show()
status.Location = New Point(0, 0)
End If
Case Is = "transfer"
If Application.OpenForms().OfType(Of tranfer).Any Then
Else
Dim status As New tranfer
status.MdiParent = Me
status.Show()
status.Location = New Point(0, 0)
End If
Case Is = "matdetail"
If Application.OpenForms().OfType(Of matDetail).Any Then
Else
Dim status As New matDetail
status.MdiParent = Me
status.Show()
status.Location = New Point(0, 0)
End If
Case Is = "unit"
If Application.OpenForms().OfType(Of unitDetail).Any Then
Else
Dim status As New unitDetail
status.MdiParent = Me
status.Show()
status.Location = New Point(0, 0)
End If
Case Is = "typedetail"
If Application.OpenForms().OfType(Of typeDetail).Any Then
Else
Dim status As New typeDetail
status.MdiParent = Me
status.Show()
status.Location = New Point(0, 0)
End If
Case Is = "process"
If Application.OpenForms().OfType(Of processDetail).Any Then
Else
Dim status As New processDetail
status.MdiParent = Me
status.Show()
status.Location = New Point(0, 0)
End If
Case Is = "pic"
If Application.OpenForms().OfType(Of user).Any Then
Else
Dim status As New user
status.MdiParent = Me
status.Show()
status.Location = New Point(0, 0)
End If
Case Is = "monthly"
If Application.OpenForms().OfType(Of monthly).Any Then
Else
Dim status As New monthly
status.MdiParent = Me
status.Show()
status.Location = New Point(0, 0)
End If
End Select
End Sub