Results 1 to 5 of 5

Thread: Unload All forms on Exit?

  1. #1
    trophyfish
    Guest

    Unload All forms on Exit?

    How do I ensure that all of my forms unload when I exit my main form, and make sure none of my program might still be running only hidden?


    I am trying to use the form collection but is this a separate component that I have to add or what?

    For i = Forms.Count – 1 to 0 Step - 1
    Unload Forms(i)
    Next

  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    Something like this
    VB Code:
    1. Dim frm As Form
    2.  
    3. For Each frm In Forms
    4.     Unload frm
    5.     Set frm = Nothing
    6. Next frm

  3. #3
    trophyfish
    Guest

    Yep that works good, thanks.

    Yep that works good, thanks.

  4. #4
    PowerPoster beachbum's Avatar
    Join Date
    Jul 2001
    Location
    Wollongong, NSW, Australia
    Posts
    2,274
    Originally posted by chrisjk
    Something like this
    VB Code:
    1. Dim frm As Form
    2.  
    3. For Each frm In Forms
    4.     Unload frm
    5.     Set frm = Nothing
    6. Next frm
    LOL Chris, I am imagining that you now have a function button that automatically posts these lines of code Don't worry, am sure it wont be asked again
    Stuart Laidlaw
    Brightspark Financial Software
    http://www.gstsmartbook.com

  5. #5
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

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