Sterling33
Member
- Joined
- Nov 17, 2005
- Messages
- 12
- Programming Experience
- 3-5
Hi all,
I was wondering if someone can help me?
Heres a bit of the code im working on. When I attempt to run it, I get an error message stating that an object reference is not set to an instance of an object. Ive narrowed the problem to the code in red. Im attempting to use the Object from Form1 in Form2. Im not to sure why im getting this error when Ive declared the object as Public when I created it.
Form1
Form2
PackageInstallerDB Class Module
-Sterling
I was wondering if someone can help me?
Heres a bit of the code im working on. When I attempt to run it, I get an error message stating that an object reference is not set to an instance of an object. Ive narrowed the problem to the code in red. Im attempting to use the Object from Form1 in Form2. Im not to sure why im getting this error when Ive declared the object as Public when I created it.
Form1
VB.NET:
Public PackageInstallerDB As New PackageInstallerDB
Private Sub btnNewPub_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNewPub.Click
Dim form2 As New form2
Form2.ShowDialog()
End Sub
VB.NET:
Private Sub btnOkNewPub_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOkNewPub.Click
[COLOR=red] form1.PackageInstallerDB.Add_Publisher("Test")[/COLOR]
End Sub
VB.NET:
Public Function Add_Publisher(ByVal strMftValue As String)
'Code to add publisher to database
End Function