Is there a technique to produce a report listing all the tables, forms, queries, reports, etc.?
Here is basic code which will accomplish what you are requesting. Simply call the Function with the appropriate Parameter:
[CODE=vb]Public Function GetObjectList(B yVal lngType As AcObjectType) As Variant
' Returns an array of object names.
' Parameters:
' intType -- one of acTable, acQuery, acForm,
' acReport, acDataAccessPag e, acMacro or acModule
Dim intI As Integer
Dim strName As String
Dim astrOutput() As String
Dim objCollection As Object
Dim aob As AccessObject
Select Case lngType
Case acTable
Set objCollection = CurrentData.All Tables
Case acQuery
Set objCollection = CurrentData.All Queries
Case acForm
Set objCollection = CurrentProject. AllForms
Case acReport
Set objCollection = CurrentProject. AllReports
Case acDataAccessPag e
Set objCollection = CurrentProject. AllDataAccessPa ges
Case acMacro
Set objCollection = CurrentProject. AllMacros
Case acModule
Set objCollection = CurrentProject. AllModules
End Select
intI = 0
For Each aob In objCollection
strName = aob.Name
intI = intI + 1
ReDim Preserve astrOutput(1 To intI)
astrOutput(intI ) = strName
Next aob
GetObjectList = astrOutput
End Function[/CODE]
[CODE=vb]Private Sub Command6_Click( )
'Given the Object type to enumerate, this Function creates a
'list of Object names and returns that string. To return just specific Objects:
Dim varList, T As Integer
'one of acTable, acQuery, acForm,
'acReport, acDataAccessPag e, acMacro or acModule
varList = GetObjectList(a cForm) 'Returns all Forms
For T = 1 To UBound(varList)
Debug.Print varList(T)
Next T
End Sub[/CODE] OUTPUT:
[CODE=text]subfChild
Switchboard
frmEmployees
frmContinuous
Main Form[/CODE]
Comment