How to detect whether a Form is Open...

  • Thread starter Thread starter John F Kappler
  • Start date Start date
J

John F Kappler

This is Access 2000, Basic code, resulting from a button click.......


I'm in FormB, which was called by either FormA1 or FormA2.

I now want to close FormB (I know how to do that) and to Refresh (I
know how to do that too!) either FormA1 or FormA2 depending on which
one is currently Open on screen. How do I detect an Open form?

I'm sure this must be possible, but cant find the condition in the
help!

Could someone pls tell me the condition statement (or give me a
clue!)?

TIA,

John

p.s. I actually want to refresh a sub-form within FormAn, but presume
that doesn't make any difference....
 
Public Sub TestIsLoaded()

If CurrentProject.AllForms("Form1").IsLoaded Then
MsgBox "It's loaded"
Else
MsgBox "It's not loaded"
End If

End Sub

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Back
Top