How To Tell if a Form is Open

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to do an If...Then...Else statement, to determine if a form is
open? Assuming there is, what would be the syntax?

Thanks, in advance.

Sharkbyte
 
Sharkbyte said:
Is there a way to do an If...Then...Else statement, to determine if a
form is open? Assuming there is, what would be the syntax?

If you're using Access 2000 or later, there are two ways. The simplest
is like this:

If CurrentProject.AllForms("YourFormName").IsLoaded Then
' the form is open
End If

The other method, which works in Access 97 as well, is to call the
SysCmd method to get the object state. There's an IsLoaded() function
that was distributed as part of one of the sample databases that does
this. It's been widely posted, so Google will turn it up if you're
interested.
 

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

Similar Threads


Back
Top