Is that form open?

  • Thread starter Thread starter Evan McCutchen
  • Start date Start date
E

Evan McCutchen

Hello everyone,

How would i go about determining if a form is open from another form? For
example, I'd like to be able to determine if Form A is open from the Open
event on Form B.

Thanks for your input!
Evan McCutchen
evan AT radiologyonesource DOT com
 
Hello everyone,

How would i go about determining if a form is open from another form? For
example, I'd like to be able to determine if Form A is open from the Open
event on Form B.

Thanks for your input!
Evan McCutchen
evan AT radiologyonesource DOT com

What version of Access?
Access 2002:
If Not CurrentProject.AllForms("FormA").IsLoaded Then
Do something here
Else
Do something else
End If

In Access 97, place this function in a Module:

Function IsLoaded(ByVal strFormName As String) As Integer
' Returns True if the specified form is open in Form view or
Datasheet
view.

Const conObjStateClosed = 0
Const conDesignView = 0

If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <>
conObjStateClosed Then
If Forms(strFormName).CurrentView <> conDesignView Then
IsLoaded = True
End If
End If
End Function
======
Then code the FormB Open event:
If Not IsLoaded("FormA") Then
Do this
Else
Do that
End if
 
Fred,

Thanks for your reply! I should have specified that I am working in access
2002... i do believe thats what i'm looking for... again, thanks!

Evan McCutchen
(e-mail address removed)
 
Back
Top