I just want to a print out of all the field names in my access table. How
can I print the list of field names.
Use the Documenter feature
Tools + Analyze + Documenter
or...
Copy and paste the below function into a module:
Function TableFieldNames()
' Get the field names from a specified table
Dim dbs As DAO.Database, tdf As DAO.TableDef, fld As DAO.Field
Set dbs = CurrentDb
Set tdf = dbs("YourTableName")
For Each fld In tdf.Fields
TableFieldNames = TableFieldNames & fld.Name & vbCrLf
Next fld
Set dbs = Nothing
End Function
Then create a new report (no record source needed).
Add one unbound control to the report
Set it's control source to:
=TableFieldNames().
Set it's CanGrow property to Yes.
Also set the Section (that the control is in) CanGrow property to Yes.