Hi All -
How can I enumerate all controls on all the forms and reports in my database, without having to open them?
This code:
Code:
Sub test()
Dim frm As Form, ctl As Control, obj As Object
For Each obj In CurrentProject.AllForms
Debug.Print obj.Name
For Each ctl In obj
Next
Next
End Sub
works fine to enumerate the forms/reports and their properties, e.g. the name, but when I try to get to the controls, the highlighted line generates the error 438, "Object doesn't support this property or method."
I tried using frm instead of obj in the For each Obj line, but that resulted in a "Type Mismatch" error.
I want to add the controls information to a database I have that lists all object references and cross references in an external (connected) database, for documentation (and cleanup of unused stuff).
Thanks