Open Tech Support
Open Tech Support Archives
Back to HomeCommunityReviewsGuidesDownloadsTech LinksMarketplaceContact Us
 »  SITE NAVIGATION
»  OTS Home
»  OTS Forums
»  OTS Archives

»  About our site
»  Search our site
»  Support our site

»  What is this site?
»  Who are we?
 
 
 »  ADVERTISMENT
 
  Pages: 1

How do you check for a Form's status

(Click here to view the original thread with full colors/images)


Posted by: jrunyon

I want to perform a check to see if a form is opened, without opening it. I tried the following code below, but it actually opens the form and I don't want to open if it isn't opened.

Case "FPolRetrvl"
If FrmP1ImgRtv.Visible = False Then
If FrmImgRtv.WindowState = 1 Then
FrmImgRtv.WindowState = 0
Else
FrmImgRtv.Show
End If
Else
RetVal = MsgBox("FMPA Image Retrieval cannot be opened with Priority1 Image Retrieval Opened. Do you want me to close Priority1 Image Retrieval?", vbYesNo, "Unable to Grant Request!")
If RetVal = 6 Then
Unload FrmP1ImgRtv
FrmImgRtv.Show
Else
Exit Sub
End If
End If



Posted by: illuminati

Function fIsLoaded(ByVal strFormName As String) As Integer
If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> 0 then
If Forms(strFormName).CurrentView <> 0 Then
fIsLoaded = True
End If
End If
End Function

And here's another way:

Public Function IsLoaded(MyFormName As String) As Boolean
Dim i As Integer
IsLoaded = False
For i = 0 To Forms.Count - 1
If Forms(i).FormName = MyFormName Then
IsLoaded = True
Exit Function
' Quit function once form has been found.
End If
Next i
End Function



Posted by: jrunyon

Thanks for the help!



 
Copyright 2000-2008 Open Tech Support.  All Rights Reserved.  Site Design and Development by Tolitz Rosel.