Not sure how useful this will be, but here is code I use to examine all the forms/reports programtically, and to extract the VBA code. What it does is save the form/report definition as a text file, then read the text file to determine object attributes, and to copy the VBA code to another file. Most of it you won't need, but I highlighted the important parts for you in red. Disregard the parts in blue, as they pertain only to the database and form the code is running in. This code is running in one database and examining forms in another, connected Access database. Code in green will have to be modified according to your file locations and names.
Code:
'
' All the Forms
'
Forms![Main Menu]![progress box].Caption = "Extracting references in forms..."
Forms![Main Menu].Repaint
Open "d:\MS office\MS_Access\objectlevels_F.txt" For Output As #2
For Each obj In ConnectApplication.CurrentProject.AllForms
'
' Copy the form to the local database
'
DoCmd.TransferDatabase acImport, "Microsoft Access", ConnectDatabaseName, acForm, obj.Name, "_" & obj.Name
referenced_Object = Nz(DLookup("object_id", "zobjects", "[object_name] = '" & obj.Name & "'"), -1)
'
' Save as a text file
'
SaveAsText acForm, "_" & obj.Name, "d:\MS office\MS_Access\" & obj.Name & ".txt"
DoCmd.DeleteObject acForm, "_" & obj.Name
Print #2, "Form - " & obj.Name
'
' Read the text file
'
Open "d:\MS office\MS_Access\" & obj.Name & ".txt" For Input As #1
NestingLevel = 0
Do
Line Input #1, Textline
If EOF(1) Then Exit Do
If Left(Trim(Textline), 5) = "Begin" Or _
InStr(strtran(Textline, " ", ""), "=Begin") > 0 Then
NestingLevel = NestingLevel + 1
Print #2, Format(NestingLevel, "00") & " " & Textline
ElseIf Left(Trim(Textline), 3) = "End" Then
Print #2, Format(NestingLevel, "00") & " " & Textline
NestingLevel = NestingLevel - 1
ElseIf Trim(Textline) = "CodeBehindForm" Then
'
' Copy all the code to a temporary file
'
Open "d:\MS office\MS_Access\module.txt" For Output As #3
Do
Line Input #1, Textline
If EOF(1) Then Exit Do
Print #3, Textline
Loop
Close #3
ProcCount = AllProcs2("d:\MS office\MS_Access\module.txt", obj.Name, 1, True)
Exit Do
Else
Print #2, Format(NestingLevel, "00") & " " & Textline
End If
Loop
Close #1
'
' You will need some code in here to deal with the code text saved to "d:\MS office\MS_Access\module.txt"
'
Next ' Work with the next form
Close
The procedure for reports is almost identical.