April 2006
Beginner
1114 pages
98h 16m
English
Document.Name
Returns the name of the specified table, query, form, or report. The following code example displays the names of all the reports in the Northwind Traders sample database in the first column of the active worksheet:
Dim strDbPath As String
Dim db As DAO.Database
Dim docRpt As DAO.Document
Dim intIdx As Integer
strDbPath = "C:\Program Files\Microsoft Office\OFFICE11\SAMPLES\Northwind.mdb"
Set db = OpenDatabase(strDbPath)
intIdx = 0
With db.Containers!Reports
For Each docRpt In .Documents
ActiveSheet.Cells(intIdx + 1, 1) = .Documents(intIdx).Name
intIdx = intIdx + 1
Next docRpt
End WithRead now
Unlock full access