home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD1259312112000.psc / modForms.bas < prev    next >
Encoding:
BASIC Source File  |  2000-12-11  |  1.4 KB  |  50 lines

  1. Attribute VB_Name = "modForms"
  2. '__________________________________________________
  3. ' Scope  : Public
  4. ' Type   : Function
  5. ' Name   : IsLoaded
  6. ' Params : 
  7. '          strFormName As String
  8. ' Returns: Boolean
  9. ' Desc   : The Function uses parameters strFormName As String for IsLoaded and returns Boolean.
  10. '__________________________________________________
  11. ' History
  12. ' CDK: 20001112: Added Error Trapping & Comments using
  13. '        Auto-Code Commenter
  14. '__________________________________________________
  15. Public Function IsLoaded(strFormName As String) As Boolean
  16.     On Error GoTo Proc_Err
  17.     Const csProcName As String = "IsLoaded"
  18.     Dim lCount As Long
  19.     For lCount = 0 To Forms.Count - 1
  20.         If (Forms(lCount).Name = strFormName) Then
  21.             IsLoaded = True
  22.             Exit For
  23.         End If
  24.     Next
  25.  
  26. Proc_Exit:
  27.     GoSub Proc_Cleanup
  28.     Exit Function
  29.  
  30. Proc_Cleanup:
  31.     On Error Resume Next
  32.     'Place any cleanup of instantiated objects here    
  33.     On Error GoTo 0
  34.     Return
  35.  
  36. Proc_Err:
  37.     Dim lErrNum As String, sErrSource As String, sErrDesc As String
  38.     lErrNum = VBA.Err.Number
  39.     sErrSource = VBA.Err.Source & vbcrlf & "modForms->"  & csProcName
  40.     sErrDesc = VBA.Err.Description
  41.     Resume Proc_Err_Continue
  42.     
  43. Proc_Err_Continue:
  44.     GoSub Proc_Cleanup
  45.     Err.Raise Number:=lErrNum, Source:=sErrSource, Description:=sErrDesc
  46.     Exit Function
  47.     
  48. End Function
  49.  
  50.