Results 1 to 2 of 2

Thread: active forms

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 1999
    Location
    Michigan
    Posts
    56

    Post

    How do I check if there is any active forms on the screen?

    I have tried
    if activeform.name = "" then

    and if activeform.name = nothing

    and non of them worked.

    Thanks.

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    You can find out if any Forms are Loaded using the Forms Collection, eg.

    If Forms.Count Then Msgbox "1 Or More Forms Loaded"

    I you have Forms Loaded, but want to know if any are visibile, Enumerate the Forms Collection Checking the Visible Property, eg.
    Code:
    Dim bActive As Boolean
    For Each Form In Forms
        If Form.Visible Then bActive = True
    Next
    If bActive Then MsgBox "There is at least 1 Form still Visible (Active)."
    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]

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