Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Dictionary

Status
Not open for further replies.

WJProctor

Programmer
Jun 20, 2003
151
GB
Hi, im doing some programming at the moment and it would be really useful to have print outs of each table with its field and field attributes. Is this possible in any way on access. Ive never personally seen it, but thought it might be some hidden feature.

Regards

JP
 
This will get you started:

Sub data_dict()
Dim tb As TableDef
Dim iCntr As Integer

For Each tb In CurrentDb.TableDefs
Debug.Print tb.Name

For iCntr = 0 To tb.Fields.Count - 1
With tb.Fields(iCntr)
Debug.Print .Name
Debug.Print .Type
Debug.Print .Size
Debug.Print .DefaultValue
End With

Next iCntr
Next tb

End Sub



You can paste that code into a module and run from the command window (ctl+g) by typing call data_dict and pressing enter.

This is DAO so you will need to provide a reference to a DAO library, if you don't already have one.

The debug.print redirects output to you command window. You can instead insert those values into a table.

Mike Pastore

Hats off to (Roy) Harper
 
Or, use the documenter that is available in the Tools menu.

Duane
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top