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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to print the record layout

Status
Not open for further replies.

rnathan

Programmer
Jun 27, 2002
41
US
Hi

I am a new user of Access. I have Access 2000 (9.0). I need to print the record layout of the database. Just don't know how. Thanks in advance.

Rita
 
On the menu bar select Tools/Analyze/Documenter. Select the tables tab, click options, and make your choices.
 
I tried to run the wizard. I am getting a msg asking me for MS 2000 Professional CD because it is not installed on my WS. Knowing our Helpdesk people, I'm pretty sure they would have misplaceed it some where. Is there anyother way? Thanks again.

Rita
 
I found this code through the help menu, may get you some of the way there, and probably would need to add some formatting to make it look nice, but this will give you the field name, size and type. Unfortunately, seems it gives the type as a number rather than text, memo, integer, etc. Based on my simple test, 10=Text 12=Memo. Perhaps someone else knows the code for displaying the actual data type. Be sure you have a reference to DAO and it appears before ADO if you are using anything above 97 such as 2000. You would substitute your table's name for MyTable. If you put this code behind a form then you could make MyTable a variable so that you could select a different table rather than hard coding it.
Code:
Sub ListFields()
    Dim dbs As Database, tdf As TableDef, fld As Field

    ' Return Database object variable pointing to current database.
    Set dbs = CurrentDb
    ' Return TableDef object variable pointing to the table.
    Set tdf = dbs.TableDefs![b]MyTABLE[/b]
    ' Enumerate fields in the table.
    For Each fld In tdf.Fields
        Debug.Print fld.Name & " " & fld.Size & " " & fld.Type
    Next fld
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top