title: Error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object
body: <p>When running my VB.Net code (below), I get the following error:</p>
  
  <blockquote>
    <p>An unhandled exception of type 'System.InvalidOperationException'
    occurred in CropModel.exe  An error occurred creating the form.  See
    Exception.InnerException for details.  The error is: Object reference
    not set to an instance of an object.</p>
  </blockquote>
  
  <pre><code>Private Class Frm_Main     
  
        Private Sub Form_MainControl_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
          Me.Reinsurance_YearTableAdapter.Fill(Me.CUNACropModelDataSet.Reinsurance_Year)
          Me.Ref_CropTableAdapter.Fill(Me.CUNACropModelDataSet.ref_Crop)
          Me.MdiParent = MDIParent1
  
        End Sub
  
        Private Sub Button_ModelLoss_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_ModelLoss.Click
  
              Frm_LossModel_Select.MdiParent = MDIParent1
              Frm_LossModel_Select.Show()
              Frm_LossModel_Select.Activate()
              'Me.Close()
  
         End Sub
   End Class
  </code></pre>
  
  <p>The debug points the issue in the following line:</p>
  
  <pre><code>Frm_LossModel_Select.MdiParent = MDIParent1
  </code></pre>
  
  <p>Seems this error is very general.  Is it possible to know where the actual error is being caused in Frm_LossModel_Select (if it is even being caused there)? The only things changed in that form were DataSet names and table names from SQL and I made sure those were all being referenced properly.  </p>
  
  <p>If additional code is needed for this issue, I'd be more than willing to provide.</p>
  
  <p>Thanks!</p>