Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to check if form is open

Status
Not open for further replies.

chonny

Programmer
Dec 16, 2004
2
0
0
BG
How to check : is form open
 
I forget to mentioned : I asking for MS ACCESS
 
Function IsLoaded(ByVal strFormName As String) As Boolean
'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
 
Depending of your version of access you may try this:
Application.CurrentProject.AllForms("name of form").IsLoaded

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top