Thanks to Allen and Fred. I will try both methods for learning purposes.
Fred, I would appreciate your "all forms and reports" method, also. I am
going to try and figure out how to do that, however, it would be nice to
have that reference in case I get stuck.
Thanks so much!
Place these 2 procedures in a module.
You can run them from there.
Public Sub FormControls()
' Read control source property of all controls in all forms.
' Note.. the debug window may not be big enough to display
' all of the data.
Dim Db As Database, doc As Document, ctl As Control
Set Db = CurrentDb
Dim intX As Integer
On Error GoTo Err_Handler
For Each doc In Db.Containers("Forms").Documents
DoCmd.OpenForm doc.Name, acDesign, , , , acHidden
Debug.Print doc.Name
On Error Resume Next
For Each ctl In Forms(doc.Name)
Debug.Print , ctl.Name & " " & ctl.ControlSource
Next
On Error GoTo Err_Handler
DoCmd.Close acForm, doc.Name
Next
Exit_FormControls:
Set Db = Nothing
Exit Sub
Err_Handler:
MsgBox "Error #: " & Err.Number & vbNewLine & Err.Description
Resume Exit_FormControls
End Sub
=============================
Public Sub ReportControls()
' Read control source property of all controls in all reports.
' Note.. the debug window may not be big enough to display
' all of the data.
Dim Db As Database, doc As Document, ctl As Control
Set Db = CurrentDb
Dim intX As Integer
On Error GoTo Err_Handler
For Each doc In Db.Containers("Reports").Documents
DoCmd.OpenReport doc.Name, acViewDesign, , , acHidden
Debug.Print doc.Name
On Error Resume Next
For Each ctl In Reports(doc.Name)
Debug.Print , ctl.Name & " " & ctl.ControlSource
Next
On Error GoTo Err_Handler
DoCmd.Close acReport, doc.Name
Next
Exit_ReportControls:
Set Db = Nothing
Exit Sub
Err_Handler:
MsgBox "Error #: " & Err.Number & vbNewLine & Err.Description
Resume Exit_ReportControls
End Sub
======