On my main form, I have a menu item that calls the below code. In the Sub New() of the form, I call a login form that determines permissions of user on that form. However, if the user presses the cancel button on the login form, the login form will close and so will the below frm. And I get an ObjectDisposedException error on the line fmr.ShowDialog(). (i.e. Cannot access a disposed object).
What do I need to to do to work around this errror. I was hoping the Try Catch statement would trap the error but it does not.
Private Sub UserMaintenanceToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UserMaintenanceToolStripMenuItem.Click
Dim frm As frmUsersMaintenance = New frmUsersMaintenance
Catch ex As Exception