PDA

Click to See Complete Forum and Search --> : I can't unload my form


Roselene
Jan 6th, 2000, 06:27 PM
Hi, everybody!

When I try to unload a form, I see the following message:
Run-time error ‘361’ Can’t load or unload this object
I’m using the "on click" event of a button, with this command:
Unload MyformName
In fact, I can only close the form by clicking on the control bar.

The MSDN help says that this error is caused when you try load or unload:
a) an object that isn’t a loadable object
b) an existing control that isn't part of a control array. For example, assuming that a TextBox with the Name property Text1 exists, Load Text1 will cause this
c) a Menu control in the Click event of its parent menu.
d) the last visible menu item of a Menu control.

But I guess all of these alternatives are inadequate in my case!

Thanks in advance for any help,
Roselene

Forest Dragon
Jan 6th, 2000, 07:50 PM
Try to use this line of code instead of your line:

Unload Me

Maybe there is a problem with calling Unload in a form with that form's name.

Good Luck!!!

Roselene
Jan 6th, 2000, 08:40 PM
Forest,

I've changed the command to Unload Me and it works!
I guess it's strange, cause I have tried to copy the Form name from its name property to the module before, in order to be sure that its name was correctly, and it hasn't work.

Why it happens?

Thanks very much for the help!
Roselene