'----------------------------------------------------------------------------
Function FU_FormIsLoaded (ByVal frmToFind As String) As Integer
'----------------------------------------------------------------------------
' AUTHOR:       Steven Gilbert
' COMPANY:      FOCUS! Technology
' CIS:		74124,2004
' DATE:         8/22/94
' DESCRIPTION : A replacement for the Microsoft example function that checks
'               to see if a given form is loaded.  The Microsoft example
'               loops through all open forms until it finds the given form
'               or exceeds the form count.  Although effeciency is probably
'               not a big concern here (how many forms are you going to have
'               loaded at a time?), a more straight forward method
'               is to try and set a test variable to the visible setting of
'		the given frmToFind and set the function
'               return value based off the occurrence/non-occurrence of an
'               error.
'----------------------------------------------------------------------------
    Dim I As Integer

    On Error GoTo FU_FormIsLoadedError

    ' Reference the form and trap for the error that occurs if the form
    ' is not loaded	
    I = Forms(frmToFind).Visible
    FU_FormIsLoaded = True
Exit Function

FU_FormIsLoadedError:
    FU_FormIsLoaded = False
Exit Function

End Function
