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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Name of loaded forms

Status
Not open for further replies.

asmall

Programmer
Dec 26, 2002
31
US
I'm trying to capture the name of the forms that are loaded.
This is the code I'm using:

Public Function IsLoaded(ByVal strFormName As String) As Boolean

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

Anyone have any suggestions?
 
Each form that is loaded (either design or runtime) is added to the forms collection. To spin through it try something like the following:

Dim frm As Object
MsgBox &quot;Open Forms: &quot; & Forms.Count
For Each frm In Forms
MsgBox frm.Name
Next frm

Good LucK!

Have a great day!

j2consulting@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top