Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Location
    Belfast, UK
    Posts
    87

    Unanswered: find out if form is open before doing action.

    Hi,

    does anyone know the code to check to see if a form is open?

    I'm trying this.

    if forms!frmsearchresults.active then.

    but it seem to complete the action anyway.

  2. #2
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    IsLoaded() is a property of AccessObjects in XP (maybe even 2000).

    The standard IsLoaded function used in access 97 is as follows:

    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
    All code ADO/ADOX unless otherwise specified.
    Mike.

Posting Permissions

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