Hello,

This should be an easy thing to do, but I can't figure out what I am doing wrong.

I have a codejock report control on the main form that list users in a database. After a new user is added thru a different form, I want the list to update. This should be easy, but I get an "object reference not set to an object" error. The code that does the update is in a class. When the user selects the option to view the users, then report control is passed byref to the sub as a parameter. On the second form I dim frm as frmMain(my main form that holds the report control) and do frm.PEPReportControl when I call the sub. The code is below of two of the things I have tried.

My form class is public, my class is public. I have done searching on the web, but haven't found any help. Also, I don't get any lines under the code. I have tried creating a reference to the form, and the control type, and pass that in the parameter, but that didn't work either.

Any help would very good. Thank you.

VB Code:
  1. Try
  2.      Dim frm As frmMain
  3.      Dim RC As AxXtremeReportControl.AxReportControl = frm.PEPReportControl
  4.      MyServerControl.AddUser(Me.UserName.Text.ToString, Me.Password.Text.ToString, Me.FName.Text.ToString, Me.LName.Text.ToString)
  5.      MyFormControl.PopulateReportControlUserInfo(RC)
  6.      frm = Nothing
  7.      Me.Hide()
  8. Catch ex As Exception
  9.      MessageBox.Show(ex.ToString)
  10. End Try

VB Code:
  1. Try
  2.     Dim frm As frmMain
  3.     MyServerControl.AddUser(Me.UserName.Text.ToString, Me.Password.Text.ToString, Me.FName.Text.ToString, Me.LName.Text.ToString)
  4.     MyFormControl.PopulateReportControlUserInfo(frm.PEPReportControl)
  5.     frm = Nothing
  6.     Me.Hide()
  7. Catch ex As Exception
  8.     MessageBox.Show(ex.ToString)
  9. End Try