+ Reply to Thread
Results 1 to 4 of 4

Checking for User Form loaded

  1. #1
    Registered User
    Join Date
    05-22-2008
    Posts
    74

    Checking for User Form loaded

    How can I test to see if a user form is loaded. If I try to access any item on the user form my code goes right into the form initialize to begin loading it. What I would like to do is test to see if the form is loaded.
    Scott
    The harder it gets the happier I am.
    Finally got my signature set up!

  2. #2
    Forum Moderator Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,373
    Quote Originally Posted by scottintexas
    How can I test to see if a user form is loaded. If I try to access any item on the user form my code goes right into the form initialize to begin loading it. What I would like to do is test to see if the form is loaded.
    Hi,

    Untested but perhaps something like:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-22-2008
    Posts
    74
    Thanks for the reply.

    What I ended up doing is setting a global variable true when the form is loaded and false when unloaded so I can just check the variable. DUH!

    Again, thanks for your help.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello scottintexas,

    You can check if any forms are loaded by checking the Count property of the UserForms collection. The most recently loaded form is at index zero.
    Please Login or Register  to view this content.
    To check if a particular form has been loaded, you have to loop through the collection and check the form name. The UserForms collection object only accepts a number for the index. This code example returns the index number in the collection for the UserForm named "UserForm1"
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1