
Multiple Forms Question: Object reference not set to an instance of an object
Hello. I am working on a program that will be able to have several of the
same form (frmLogs). I developed the form to run by itself, and it worked
great. Now, I added a 'Sub New' and tried to call it from another form
(frmSwitchboard), but I keep getting errors.
----------------------------------
Here is what I have in frmLogs:
Dim mdblJobNo As Double
[Windows Form Designer generated code]
Sub New(ByVal JobNo As Double)
mdblJobNo = JobNo
End Sub
Here is what I have in frmSwitchboard:
Dim f As New frmLogs(cmbJobID.SelectedValue)
f.Show()
------------------------
Almost every line of code will break and say 'Object reference not set to an
instance of an object.' For example, this line breaks:
Me.SelCmdHoles.Parameters.Item("pJobNo").Value = mdblJobNo
Is there something I am missing? Do I need to refer to the particular
instance of the form somehow?
Thanks,
Joe