Results 1 to 2 of 2

Thread: Testing For an Open Form

  1. #1
    Join Date
    Jan 2003
    Location
    UK
    Posts
    55

    Testing For an Open Form

    How do I test if a Form is open?

    Many thanks

  2. #2
    Join Date
    Jul 2005
    Posts
    2

    Find out if Form or Report is open.

    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
    ---------------------------------------------------------------------------------------------
    Function IsLoadReport(ByVal strReportName 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, acReport, strReportName) <> conObjStateClosed Then
    If Reports(strReportName).HasData <> conDesignView Then
    Reports(strReportName).AutoCenter = True


    While SysCmd(acSysCmdGetObjectState, acReport, strReportName) = acObjStateOpen
    DoEvents
    Wend

    IsLoadReport = True
    End If
    End If

    End Function

    I never had problem using them, so far.
    doug

Posting Permissions

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