Try Tools>Analyze>Documentor
I think you need to go through this document from Microsoft
How to List the Fields in a Table Using the Fields Collection
# Start a new project in Visual Basic. Form1 is created by default.
# Add two list boxes to Form1.
# Double-click the form to open the code window. Add the following code to the Form
Load event:
Code:
Sub Form_Load ()
Set MyDb = OpenDatabase("BIBLIO.MDB")
' Set AllTableDefs to definitions of all tables in the database:
Set AllTableDefs = MyDb.TableDefs
' Display names of all tables in database:
For j = 0 To AllTableDefs.Count - 1
List1.AddItem AllTableDefs(j).Name
Next
End Sub
# Double-click the List1 list box and enter the following code in its Click event:
Code:
Sub List1_Click ()
' Delete any existing entries in List2 box:
Do While list2.ListCount > 0
list2.RemoveItem 0
Loop
' Get the definition of the single table currently selected in List1:
Set SingleTableDef = MyDb(List1.List(List1.ListIndex))
' Display the properties of each field in the table:
For j = 0 To SingleTableDef.Fields.Count - 1
list2.AddItem "Field item number " & Val(j) & ":"
' Display the name of the field in the table selected in List1:
list2.AddItem SingleTableDef.Fields(j).Name
' or use the following since Fields are the default collection:
' List2.AddItem SingleTableDef(j).Name
list2.AddItem SingleTableDef.Fields(j).Size ' Size of field.
list2.AddItem SingleTableDef.Fields(j).Type ' Type of field.
' If field is an index, list the name of the index:
If j <= SingleTableDef.Indexes.Count - 1 Then
list2.AddItem "Index name: " & SingleTableDef.Indexes(j).Name
End If
' The Value property is only valid if part of a recordset:
' list2.AddItem SingleTableDef.Fields(i).Value
' The other 5 properties are valid for a field of TableDef object:
list2.AddItem SingleTableDef.Fields(j).OrdinalPosition
list2.AddItem SingleTableDef.Fields(j).CollatingOrder
list2.AddItem SingleTableDef.Fields(j).Attributes
list2.AddItem SingleTableDef.Fields(j).SourceField
list2.AddItem SingleTableDef.Fields(j).SourceTable
list2.AddItem " "
Next
End Sub
# From the File menu, choose New Module. Then enter the following code in the General Declarations section:
Code:
Global MyDb As Database
Global SingleTableDef As TableDef
Global AllTableDefs As TableDefs
# Start the program. Click any table name in the first list box. In the second list box, the program displays all the fields and field properties for that table. Close the form to end the program. NOTE: Some MSys* tables (such as MSysACEs) have no fields.
Bookmarks