What version of Access?
For 2000 and higher, the CurrentData and CurrentProject objects have a
number of collections in it that will return the tables, forms, reports,
etc.
To list all forms, for example, you can use
Sub AllForms()
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentProject
' Search for open AccessObject objects in AllForms collection.
For Each obj In dbs.AllForms
Debug.Print obj.Name
Next obj
End Sub
There are more details at
http://msdn.microsoft.com/library/en-us/vbaac10/html/acobjCurrentData.asp
http://msdn.microsoft.com/library/en-us/vbaac10/html/acobjCurrentProject.asp
For 97 and earlier, you can get the tables from the DAO TableDefs
collection, and the queries from the DAO QueryDefs collection. Forms,
reports and the rest are stored in various Containers.
To list all forms, you'd use
Sub AllForms()
Dim dbCurr As DAO.Database
Dim conForms As DAO.Container
Dim docForm As DAO.Document
Set dbCurr = CurrentDb()
Set conForms = dbCurr.Containers("Forms")
For Each docForm In conForms.Documents
Debug.Print docForm.Name
Next docCurr
End Sub
Indexes are a collection of the TableDef object.