Results 1 to 3 of 3

Thread: How do I close all forms?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    Gloucestershire, England
    Posts
    301

    Question

    I want to close all the forms when a user clicks on a button (without knowing the names of the forms)

    Any ideas?

    Cheers

  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Lightbulb Forms Collection

    Just sa simple as this.
    Code:
    Private Sub Command1_Click()
    Dim nForm As Form
    For Each nForm In Forms
        Unload nForm
    Next
    End Sub

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    Gloucestershire, England
    Posts
    301
    Cheers Chris, works a treat

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