My problem is this. I have this module that contains an integer variable and this variable is accessed by a form that changes its value, as the code below shows.
Module Module1
Public frm1 As New Form1
Public frm2 As New Form2
Public Uso As Integer
End Module
Public Class Form1
...
Private Sub MenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem4.Click
Uso = 1
frm2 = New Form2
frm2.MdiParent = Me
frm2.Text = "PROJETO DE TROCADOR DE CALOR"
frm2.Show()
End Sub
End Class
When compiling it normally opens form1 (MdiContainer). When I try to open a new file, MenuItem4_Click
, throws an exception. It says that the reference of an object was not defined for an instance of this object.
This error happens with ALL the variables in this Module1 that frm2 tries to access / modify.
I have done other programs using the same logic that never gave this bizarre error. I really need help !!!!