Form count : Form « Forms « VBA / Excel / Access / Word






Form count

 

Sub exaFormsContainer()
    Dim db As Database
    Dim frm As Form
    Dim doc As Document
    
    Set db = CurrentDb
    
    Debug.Print "Opened form count: " & Forms.Count
    For Each frm In Forms
        Debug.Print frm.Name
    Next
    Debug.Print "Saved form count: " & db.Containers!Forms.Documents.Count
    For Each doc In db.Containers!Forms.Documents
        Debug.Print doc.Name
    Next

End Sub

 








Related examples in the same category

1.Change caption
2.Display form in Modal mode
3.Close a form
4.To remove the Userform from the computer's memory, you must use the Unload statement; otherwise, the Userform is only hidden.
5.Creating UserForms Programmatically
6.Adding Controls to a UserForm at Design Time
7.Output form to html file
8.Using the Show Method to Display a Form
9.Loading a Form into Memory Prior to Displaying It
10.Cancels a cancelable event (an event that has a Cancel parameter).
11.Open a form, format the fonts and close it
12.Format fonts