Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2011
    Posts
    16

    Answered: prevent main form close if any other form is open

    Hello,
    I simply would like to prevent users from closing the frmMain form, if any other form is open. There are many other forms so i didn't want to check if open for all of them individually. Would just like it to be: If any form not named frmMain, then don't allow frmMain to close.

    Thanks

  2. Best Answer
    Posted by ranman256

    "if forms.count >1 then exit sub"


  3. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    495
    Provided Answers: 24
    if forms.count >1 then exit sub

  4. #3
    Join Date
    Oct 2011
    Posts
    16
    Worked great. Perfect and simple. I just added to to the main form's unload event: If Forms.Count > 1 Then Cancel = True

    Thanks so much!

Tags for this Thread

Posting Permissions

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