Results 1 to 6 of 6

Thread: MDI Forms -- Unload or Hide MDI and show non MDI form -- HELP

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Location
    Canada
    Posts
    70
    I am writing an application which has a login screen and
    a log off button.
    When the application loads the login screen is display. The user logs in and a MDI form is shown with various forms positioned within it (thanks megatron for the code to remove MDI resizing).
    The user will press a button to log off -- this will trigger all forms to be set to nothing, the mdi form to unload and the logon screen to be shown again.

    How do I unload a mdi form from a logoff button without closing the application?



  2. #2
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Cool Not sure but

    What happens if the login form is NOT a MDIchild (vbmodal)? If you close the MDIform, it may not close the application. Try it and let me know...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Location
    Canada
    Posts
    70
    The login form is not a MDI Child and it does cloes
    the application properly.
    What I need is a button on a MDI Child form which, when
    pressed, will terminate all the forms Including the MDIform
    and then show the login form.

    In other words, it's a never ending cycle. Once
    the application is loaded, the only way a user could
    actually exit the application is by using a specific
    login and password. For example, a login of say, Good, and a password of Bye would be the only way the user could
    close the application. This way only certain users would
    have the ability to stop the application.







  4. #4
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Talking Ok my next attempt...

    On your close event...

    Dim Form As Form

    For Each Form In Forms

    Unload Form

    Set Form = Nothing

    Next Form

    End

    then

    frmLogin.Show

    Would this work?

    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  5. #5

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Location
    Canada
    Posts
    70

    Thanks

    My biggest mistake was I was manually typing in the
    unload statement and referring to the MDI form with it's
    name not the name of the variable set as the MDI form.
    Using your example of course, cleared that problem and
    showed me where I went wrong.
    Your suggestion worked perfectly.

    Thanks


  6. #6
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    rlb_wpg:

    Your quite welcome. I'm glad I could help (even though it wasn't exactly what you needed).
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

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