Results 1 to 3 of 3

Thread: I can't unload my form

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 1999
    Location
    Itabirito,Minas Gerais, Brazil
    Posts
    79

    Post

    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


  2. #2
    Addicted Member
    Join Date
    Oct 1999
    Posts
    253

    Post

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

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 1999
    Location
    Itabirito,Minas Gerais, Brazil
    Posts
    79

    Post

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width