I have a basic table in access with several populated fields. I would like to explore if there is a way, preferably through the GUI (or maybe through SQL), to add a field containing the name of the table itself. I see only the following data formats for fields: Short text, Long text, number, Date/time, Currency, Autonumber, Yes/No, OLE Object, Hyperlink, Attachment and Calculated. There is nothing pertaining to data object parameters themselves such as table, field or query names or parameters...
1 Answer
You can access the meta data of the database via VBA (Visual Basic for Applications) macros.
For example, this can show all table names:
Option Compare Database
Public Sub Test()
Dim database As DAO.database
Dim tableDef As DAO.tableDef
Set database = CurrentDb
For Each tableDef In database.TableDefs
MsgBox tableDef.Name
Next
End Sub