Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2002

    Unanswered: Testing for an Open Form

    On exiting a form I am trying to detect if another form is open using the following code in an On Exit event.

    If IsOpen("ENQUIRIES") Then
    End If

    but it doesn't seem to like the IsOpen. Is there another way of testing for an open form?

  2. #2
    Join Date
    Nov 2002
    San Francisco

    Re: Testing for an Open Form

    this is Microsoft's Function ..... works well for me....

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts