This is a non-trivial topic, hence the dearth of replies. Bumping probably isn't a good idea; it gives the idea that an answer has been generated.
0) Create a form with a tree control (active x)
1) Create a module with this code:
[tt]
Option Compare Database
Option Explicit
Sub AddSub(TheLine As String, MyTreeView As Object, ParentNode)
Dim SpacePos As Integer
SpacePos = InStr(TheLine, " "

Dim ParenPos As Integer
ParenPos = InStr(TheLine, "("

If SpacePos <> 0 And ParenPos <> 0 Then
Dim FunctionName As String
FunctionName = Mid(TheLine, SpacePos + 1, ParenPos - SpacePos - 1)
MyTreeView.Nodes.Add ParentNode, tvwChild, FunctionName, FunctionName
Debug.Print " [" & Mid(TheLine, SpacePos + 1, ParenPos - SpacePos - 1) & "]"
End If
End Sub
Sub ProcessModule(TheModule As Module, MyTreeView As Object, ParentNode)
If Not TheModule Is Nothing Then
Debug.Print TheModule.Name
Dim LineCount As Long
LineCount = TheModule.CountOfLines
Dim ModuleNode As Node
Set ModuleNode = MyTreeView.Nodes.Add("Root", tvwChild, TheModule.Name, TheModule.Name)
Dim counter As Long
For counter = 1 To LineCount
Dim CurLine As String
CurLine = TheModule.Lines(counter, 1)
If Left(CurLine, 4) = "Sub " Or Left(CurLine, 9) = "Function " Then
AddSub CurLine, MyTreeView, ModuleNode
End If
Next counter
End If
End Sub
Sub FindFunctions(MyTreeView As Object)
Application.Echo False
Dim CurDb As Database
Set CurDb = CurrentDb
Dim ModulesContainer As Container
Set ModulesContainer = CurDb.Containers("Modules"
Dim CurDoc As Document
Dim TheModule As Module
Dim ParentNode As Node
Set ParentNode = MyTreeView.Nodes.Add(, , "Root", "Root"
For Each CurDoc In ModulesContainer.Documents
Debug.Print CurDoc.Name
On Error Resume Next
Set TheModule = Nothing
DoCmd.OpenModule CurDoc.Name
Set TheModule = Modules(CurDoc.Name)
ProcessModule TheModule, MyTreeView, ParentNode
DoCmd.Close acModule, CurDoc.Name
Next CurDoc
Set CurDoc = Nothing
Set ModulesContainer = Nothing
Set ModulesContainer = CurDb.Containers("Forms"
For Each CurDoc In ModulesContainer.Documents
On Error Resume Next
Set TheModule = Nothing
If Not CurDoc.Name = "TheFormWithTheTreeControlInIt" Then
DoCmd.OpenForm CurDoc.Name, acDesign
Set TheModule = Forms(CurDoc.Name).Module
ProcessModule TheModule, MyTreeView, ParentNode
DoCmd.Close acForm, CurDoc.Name, acSaveNo
End If
Next CurDoc
Set CurDoc = Nothing
Set ModulesContainer = Nothing
Application.Echo True
End Sub
[/tt]
2) Add this to the form's OnLoad event:
[tt]
Private Sub Form_Load()
FindFunctions Me.TheTreeCtrl
End Sub
[/tt]