Yep - anything that causes the main form to UNLOAD will cause that code to execute. Of course, I am ASSUMING that the "orphaned" form is the cause of your problem, and I may be wrong...