G
Ghost Dog
I inherited a legacy app and I need to find specific verbage which may exist
in code, queries, forms, or reports. Searching the code is trivial, and
searching the SQL property in the querydefs collection is similarly
straightforward. The problem is searching forms and reports. The original
developers used a number of IIF statements in the data properties of various
controls (text boxes, etc) where the specific verbage I'm looking for might
appear. I tried using the AllForms collection as follows:
Public Function DebugFindStuff()
Dim dbs As Object
Dim f As Form
Dim ctl As Control
Set dbs = Application.CurrentProject
Dim i%, j%, k%
For i = 0 To dbs.AllForms.Count
Set f = dbs.AllForms(i)
For j = 0 To f.Controls.Count
Set ctl = f.Controls(j)
Debug.Print ctl.Name
Next j
Next i
End Function
, but that doesn't work, probably because the form isn't loaded.
Anybody have a code snippet to loop through the properties
of all forms and reports?
in code, queries, forms, or reports. Searching the code is trivial, and
searching the SQL property in the querydefs collection is similarly
straightforward. The problem is searching forms and reports. The original
developers used a number of IIF statements in the data properties of various
controls (text boxes, etc) where the specific verbage I'm looking for might
appear. I tried using the AllForms collection as follows:
Public Function DebugFindStuff()
Dim dbs As Object
Dim f As Form
Dim ctl As Control
Set dbs = Application.CurrentProject
Dim i%, j%, k%
For i = 0 To dbs.AllForms.Count
Set f = dbs.AllForms(i)
For j = 0 To f.Controls.Count
Set ctl = f.Controls(j)
Debug.Print ctl.Name
Next j
Next i
End Function
, but that doesn't work, probably because the form isn't loaded.
Anybody have a code snippet to loop through the properties
of all forms and reports?