Document Object, Documents Collection Example (MDB)

The following example prints the name of each Form Document object in the current database and the date it was last modified:

Sub DocumentModified()
    Dim dbs As Database, ctr As Container, doc As Document

    ' Return reference to current database.
    Set dbs = CurrentDb
    ' Return referenct to Forms container.
    Set ctr = dbs.Containers!Forms
    ' Enumerate through Documents collection of Forms container.
    For Each doc In ctr.Documents
        ' Print Document object name and value of
        ' LastUpdated property.
        Debug.Print doc.Name; "      "; doc.LastUpdated
    Next doc
    Set dbs = Nothing
End Sub