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

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!!!!
 
B

Bernie Yaeger

Hi Chris,

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

Bernie Yaeger
 
G

Guest

Hi

You maybe try to open the form like this:

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

best regards
Frank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top