|
-
Dec 7th, 2006, 08:27 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Object not set error
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:
Try
Dim frm As frmMain
Dim RC As AxXtremeReportControl.AxReportControl = frm.PEPReportControl
MyServerControl.AddUser(Me.UserName.Text.ToString, Me.Password.Text.ToString, Me.FName.Text.ToString, Me.LName.Text.ToString)
MyFormControl.PopulateReportControlUserInfo(RC)
frm = Nothing
Me.Hide()
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
VB Code:
Try
Dim frm As frmMain
MyServerControl.AddUser(Me.UserName.Text.ToString, Me.Password.Text.ToString, Me.FName.Text.ToString, Me.LName.Text.ToString)
MyFormControl.PopulateReportControlUserInfo(frm.PEPReportControl)
frm = Nothing
Me.Hide()
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|