1. table name
2- Primary key name
3. Primary key field name
The following gets me the table names, but I don't know how to gather the other two pieces of information for each table.
Code: Select all
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim rst As DAO.Recordset
Dim strName As String
Set db = CurrentDb()
Set rst = db.OpenRecordset("tlkpTablesAndkeys", dbOpenDynaset)
For Each tdf In db.TableDefs
strName = tdf.Name
rst.AddNew
rst!TableName = strName
rst.Update
Next
rst.Close
Set rst = Nothing
MsgBox "SQL Tables have been read into the table"
Thanks!
Ken