Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Test if Form is Already Open

Status
Not open for further replies.

jwalz

Programmer
Oct 31, 2000
78
0
0
US
I need help determining if an Access form is already open, so that I can perform some field refreshing and/or updating from changes to another form. Is there a function that will allow me to test for this?

Thanks,
Janet
 
Direct from Access's sample database (Northwind)....

Code:
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

Randy
 
Thanks Randy. That did the trick.

Janet
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top