Public Function isOpen(strName As String, Optional intObjectType As Integer = acForm) As Boolean
On Error GoTo err_isOpen
'Returns True if strName is open, False otherwise.
'Assume the caller wants to kmow about a form.
isOpen = (SysCmd(acSysCmdGetObjectState, intObjectType, strName) <> 0)
exit_isOpen:
Exit Function
err_isOpen:
MsgBox Err.Description
Resume exit_isOpen
End Function