Results 1 to 4 of 4

Thread: amazing non-unloading form HELP

  1. #1

    Thread Starter
    Frenzied Member wengang's Avatar
    Join Date
    Mar 2000
    Location
    Beijing, China
    Posts
    1,604
    Hey all.
    what is happening here?
    I have two forms and I'm using the same code I've used 100s of times before to switch back and forth.

    On formA, a button click event:

    Load formB
    formB.Show
    Unload formA

    On formB, a button click event:

    Load formA
    formA.Show
    Unload formB

    Isn't that what everybody does?

    Well, I don't know what's happening here, but I have a case where formB loads but it won't unload. When I click to formB, it appears and A unloads. But then when i click back to A, formB is still there, behind formA. I don't know why! I've tried several things:
    in the queryunload, I put Set formB = Nothing
    I've typed unload formB several times in the code

    At runtime, when the form is still visible behind formA, I can close it by clicking on its X block ( after the first try at closing via the button). Or I can leave via the xblock on the form (and put a Load formA in the queryunload sub). But I'm really just wondering what would cause this.

    Oh, I am using a Form_MouseMove sub but I used a boolean to exit this sub if the form changing button is pressed.

    Ideas?

    Thanks

    Wengang













    Wen Gang, Programmer
    VB6, QB, HTML, ASP, VBScript, Visual C++, Java

  2. #2
    Fanatic Member
    Join Date
    Jan 1999
    Location
    UK
    Posts
    554
    Just rem out your code in the mouse_move and see if it still plays up...

    Pretty sure it's in there somewhere


    DocZaf
    {;->

  3. #3
    Addicted Member
    Join Date
    Sep 2000
    Posts
    138
    Put the Unload statement before the .Show method and see.
    And make sure they are not Modal forms (We can see they are not from your code).

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    There is nothing wrong with the code you submitted so it has to be somewhere else.

    If possible post all of your code so that people around here can have a look at it.

    Best regards

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