Can I test to see whether a form is loaded or not?

casey

Registered User.
Local time
Today, 23:32
Joined
Dec 5, 2000
Messages
448
Is there a property to test to see if a form is currently open. I would like write code to requery a control on one of two forms, but I need to test to see which form is open before I requery its control. Is there a property that will give me this? I've looked in help, but I haven't found it. Thanks.
 
Here is a function that will check if a form is open:

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

HTH
RDH
 
R. Hicks,

Your function works great. Thanks for the help.
 
Access 2000 has a function that does this for you

CurrentProject.AllForms("frmName").IsLoaded
 

Users who are viewing this thread

Back
Top Bottom