Check a form without opening it..

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.
 
G

Gerald Stanley

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
 
V

Van T. Dinh

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top