Link to home
Start Free TrialLog in
Avatar of Cory Vandenberg
Cory VandenbergFlag for United States of America

asked on

Unload Me is causing an error which closes all forms

I have a form which is initialized and shown by code from a button on another form.  When the "embedded" form is closed, the original form is also closed and unloaded.  If I just Hide the "embedded" form, there is no issue.

Now, to get around this, in the main form I am using

Unload formASD
formASD.Show

and in the formASD I'm just using

Me.Hide

That solution is fine.  I guess I am just curious if the behavior I am experiencing when using Unload Me on the embedded form is normal or not?

WC
ASKER CERTIFIED SOLUTION
Avatar of Rory Archibald
Rory Archibald
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Cory Vandenberg

ASKER

Thanks for the tip Rory.  Always looking for best practices.

The trick was, someone could load the form once, Cancel, then load it again with a different location (form list files in a folder designated on the main form).

Thus I need to Unload the formASD before I Show it, just in case it's not the first time.

Cheers,
WC