hiding the form didn't do it. Having the last thing the button does be unloading the form is what did it. Think of it this way..

All the code in your form is essentially part of the form. If you unload it, you can't execute the code in it. So having a function that does the following..


Code:
Unload Me
MainForm.Visable = True
Is a problem waiting to happen. You're telling the form to unload but you have code in that form that's still waiting to execute. I can't say speciffically what will happen if this is done but I'd guess that either

a) The part after the Unload isn't going to happen.. or
b) the form is going to try to unload and cancel because
there's still code to execute.

You don't have to specifically hide the form but if you want to make the form not visable while something else happens then you may want to..

In the above example, the correct way to do it would be

Code:
MainForm.Visable = True
Unload Me
but that will make the main form visable and then make the sub form go away. That may not be the visual effect that you want.. so you'd do..


Code:
Me.Hide
MainForm.Visable = True
Unload Me

Let me know if this answered your question...