Check a form without opening it..

  • Thread starter Thread starter Warrio
  • Start date Start date
W

Warrio

Hello!

How is it possible to check if a form is open without loading it
automaticly?..
because if I try to run the code below, the form is loaded automaticaly and
apears on the top of the actual form..

If Form2.Visible Then
...
Endif

Thanks for any suggestion.
 
The list of open forms is held as the Forms collection, so
code along these lines should achieve what you are after

For Each frmCurr In Forms
If frmCurr.Name = "Form2" Then
<write your own action>
End If
Next

Hope This Helps

Gerald Stanley MCSD
 
I am not entirely sure of your question since a Form can be open / loaded in
the memory and still invisible. Loaded and Visible are 2 different states.

Assume you meant open / loaded and if you use A2K or later, try:

?CurrentProject.AllForms.Item("FormName").IsLoaded

which will return True (Form is loaded) or False.
 
Back
Top