VBA/Excel/Access/Word/Forms/Forms — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 12:48, 26 мая 2010
Loop through the documents in Forms
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
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
Use the form object variable to point at each form in the Forms collection
Sub IterateOpenForms()
Dim frm As Form
For Each frm In Forms
"Print the name of the referenced form to the Immediate window
Debug.Print frm.Name
Next frm
End Sub