programmatically check if form is open

  • Thread starter Thread starter tracey
  • Start date Start date
This should work for the newer versions of Access ...

If IsLoaded("MyForm") then
<your code>
End if

Function IsLoaded(MyFormName) As Boolean
' Accepts: a form name
' Purpose: determines if a form is loaded
' Returns: True if specified the form is loaded;
' False if the specified form is not loaded.

If CurrentProject.AllForms(MyFormName).IsLoaded Then
IsLoaded = True
Exit Function
End If

End Function
 
Back
Top