I have a piece of code (see below) that prints the field names of a designated table to the immediate window. I find it very handy. I would like to be able to do the same thing but instead of listing field names of a table I'd like to be able to list all the control names on a designated form object. I couldn't find anything in my search so I thought I'd ask around. Thanks.
Private Sub PrintTableFieldNames()
Dim db As DAO.Database
Dim td As DAO.TableDef
Dim f As DAO.Field
Set db = CurrentDb
Set td = db.TableDefs("tblExample"
For Each f In td.Fields
Debug.Print f.Name
Next f
End Sub
Private Sub PrintTableFieldNames()
Dim db As DAO.Database
Dim td As DAO.TableDef
Dim f As DAO.Field
Set db = CurrentDb
Set td = db.TableDefs("tblExample"
For Each f In td.Fields
Debug.Print f.Name
Next f
End Sub