"OBJECT REFERENCE NOT SET TO AN INSTANCE OF AN OBJECT"

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way of destroying all objects when a form closes so that the
correct objects
can be created once the form is REopened? error i am getting is :

"OBJECT REFERENCE NOT SET TO AN INSTANCE OF AN OBJECT"

when opened and closed repetedly and alternating between the 2 "modes"
(AddEmp and ModifyEmP).



If the project is shutdown and restarted this error doesn't occur.

Thanks in anticipation!!!!
 
Hi Chris,

Show us some code, Chris; I doubt that your assumption is correct.

Bernie Yaeger
 
Hi

You maybe try to open the form like this:

if (yourform.IsDisposed)
{
yourform = new yourform();
}

best regards
Frank
 
Back
Top