Check if object is loaded.

Posted on 2003-02-27
Medium Priority
Last Modified: 2012-05-05
Is there a function or any way to check if a form is loaded? For example, I want to set the TextBox on a form to "Hello World", but only if that form is already loaded. If I call anything on the form, like .Visible, it loads the form. I'm looking for something like a

IsLoaded(frmCheck as Form) as Boolean

Anyone know of a way I could do this? or a function that already exists? I'd prefer not to set Global flags for every form I want to do this on.
Question by:dankennedy
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Expert Comment

ID: 8035175
Can you not use Load()?

Private Sub Form1_Load()

End Sub

Author Comment

ID: 8035213
Oh sorry. I don't think my question made sense. I actually want to check if a form is loaded from another form. Like, in form1 I want to say IsLoaded(form2).
LVL 44

Accepted Solution

Arthur_Wood earned 300 total points
ID: 8035221
try something along these lines:

Private Function IsLoaded(frmCheck as Form) as Boolean
   dim blnResult as Boolean
   Dim frm as Form
   for each frm in Forms
     if frm.Name = frmCheck.Name then
        blnResult = True
        Exit For
     end if
   IsLoaded = blnResult
end Function

this should get you what you need.


Author Comment

ID: 8035372
Yes... exactly what I want. Thanks.

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question