ACCESS 2003
I want to create a simple list of tables, fileds and field descriptions for my Access 2003 application.
In table design mode, each field has a field name, data type and "description" column for documenting.
Example: Filed Name = "Bind_Date", Data Type = Date/Time and a description of "added 1/17/2006 used for retention and succession vakidation"
I have code to get the table name and field name but I cannot figure out how to reference and get the value in the field description.
Can anybody bail me out?
Thanks,
Brad
Burlington, VT
Here is the code I am using:
Sub List_Tables_Fields_Description()
Dim Dbs As DAO.Database
Dim tbl As DAO.TableDef
Dim fld As DAO.Field
Dim i
Dim strTableName As String
Set Dbs = CurrentDb()
With Dbs
For Each i In .TableDefs 'Look thru tabledef collection f
Set tbl = Dbs.TableDefs(i.Name)
If InStr(1, i.Name, "MSYS") = 0 Then
If i.Name = "INCOMING_DATA" Then 'Testing
For Each fld In tbl.Fields
Debug.Print "Table Name: " & tbl.Name _
& " Field Ordinal Position: " & fld.OrdinalPosition _
& " Field Name: " & fld.Name _
& " Field Type: " & fld.Type _
& " Field Size: " & fld.Size
Next fld
End If 'Testing
End If
Next i
End With
msgbox "All Done"
Dbs.Close
Set Dbs = Nothing
End Sub
I want to create a simple list of tables, fileds and field descriptions for my Access 2003 application.
In table design mode, each field has a field name, data type and "description" column for documenting.
Example: Filed Name = "Bind_Date", Data Type = Date/Time and a description of "added 1/17/2006 used for retention and succession vakidation"
I have code to get the table name and field name but I cannot figure out how to reference and get the value in the field description.
Can anybody bail me out?
Thanks,
Brad
Burlington, VT
Here is the code I am using:
Sub List_Tables_Fields_Description()
Dim Dbs As DAO.Database
Dim tbl As DAO.TableDef
Dim fld As DAO.Field
Dim i
Dim strTableName As String
Set Dbs = CurrentDb()
With Dbs
For Each i In .TableDefs 'Look thru tabledef collection f
Set tbl = Dbs.TableDefs(i.Name)
If InStr(1, i.Name, "MSYS") = 0 Then
If i.Name = "INCOMING_DATA" Then 'Testing
For Each fld In tbl.Fields
Debug.Print "Table Name: " & tbl.Name _
& " Field Ordinal Position: " & fld.OrdinalPosition _
& " Field Name: " & fld.Name _
& " Field Type: " & fld.Type _
& " Field Size: " & fld.Size
Next fld
End If 'Testing
End If
Next i
End With
msgbox "All Done"
Dbs.Close
Set Dbs = Nothing
End Sub