Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Printing the Table Structure
John Kuhlken 
    
11 months ago
How do I print the "Table" structure?
Richard Rost  @Reply  
          
11 months ago
There really isn't an easy way to do that in Access. Your best bet is to just take a screen shot.
Alex Hedley  @Reply  
            
11 months ago
Tool->Analyze->Documenter ?
Alex Hedley  @Reply  
            
11 months ago
Alex Hedley  @Reply  
            
11 months ago
Richard this could be a nice feature of Object Size Analyzer
Richard Rost  @Reply  
          
11 months ago
Interesting. Did you try it? Any good?
Alex Hedley  @Reply  
            
11 months ago
Don't have a visio license.
Martin Fairbairn  @Reply  
    
11 months ago
In my view, the best way to do that is outside Access and do it in bite-sized chunks so it doesn't turn into a spider's web.  i do it in Omnigraffle on the Mac but Visio and LucidChart can also work.  I wish Access had the ability to do discrete 'module" relationship charts in separate pages.
Juan Rivera  @Reply  
            
11 months ago
not sure if this is what you are looking for but i use this when i have put down a project for some time and just need a quick look at the table.
DetailsPublic Sub ExportTableStructureToNotepad()
    Dim db As DAO.Database
    Dim td As DAO.TableDef
    Dim fld As DAO.Field
    Dim tableName As String
    Dim tempFile As String
    Dim textOut As String
    Dim fnum As Integer
    
    ' Prompt for table name
    tableName = InputBox("Enter the table name to export field names and data types:", "Table Structure Export")
    If tableName = "" Then Exit Sub

    Set db = CurrentDb()

    On Error GoTo ErrHandler
    Set td = db.TableDefs(tableName)
    
    textOut = "Table: " & tableName & vbCrLf & String(60, "-") & vbCrLf
    textOut = textOut & "Field Name" & vbTab & "Data Type" & vbCrLf
    textOut = textOut & String(60, "-") & vbCrLf
    
    For Each fld In td.Fields
        textOut = textOut & fld.Name & vbTab & GetFieldTypeName(fld.Type) & vbCrLf
    Next fld

    ' Write to temporary file
    tempFile = Environ("TEMP") & "\TableStructure.txt"
    fnum = FreeFile
    Open tempFile For Output As #fnum
    Print #fnum, textOut
    Close #fnum

    ' Launch Notepad
    Shell "notepad.exe " & Chr(34) & tempFile & Chr(34), vbNormalFocus

    Exit Sub

ErrHandler:
    MsgBox "Error: " & Err.Description, vbCritical, "Could not read table structure"
End Sub
David Semon  @Reply  
      
11 months ago
Juan, where is GetFieldTypeName defined?  When I tried to run your code, I get an error:  Sub or Function not defined.
Juan Rivera  @Reply  
            
11 months ago
Call ExportTableStructureToNotepad

call this from a button.   load the public sub from a global mod.  it will open notepad and list the table structure.  got this idea from Richard.

hope this  helps.
David Semon  @Reply  
      
11 months ago
I guess I am missing something.  Where is GetFieldTypeName defined?  Where did you get the idea from Richard?  Thanks.
Kevin Robertson  @Reply  
          
11 months ago
Juan There is a helper Function mentioned in your code above, but you don't show what it is.

    For Each fld In td.Fields
        textOut = textOut & fld.Name & vbTab & GetFieldTypeName(fld.Type) & vbCrLf
    Next fld
Juan Rivera  @Reply  
            
11 months ago
Im out at work I will look for it tonight and post it.
Juan Rivera  @Reply  
            
11 months ago
' Helper function to convert DAO data type to readable name
Private Function GetFieldTypeName(typeCode As Integer) As String
    Select Case typeCode
        Case dbBoolean: GetFieldTypeName = "Yes/No"
        Case dbByte: GetFieldTypeName = "Byte"
        Case dbInteger: GetFieldTypeName = "Integer"
        Case dbLong: GetFieldTypeName = "Long"
        Case dbCurrency: GetFieldTypeName = "Currency"
        Case dbSingle: GetFieldTypeName = "Single"
        Case dbDouble: GetFieldTypeName = "Double"
        Case dbDate: GetFieldTypeName = "Date/Time"
        Case dbText: GetFieldTypeName = "Text"
        Case dbLongBinary: GetFieldTypeName = "OLE Object"
        Case dbMemo: GetFieldTypeName = "Long Text"
        Case dbGUID: GetFieldTypeName = "GUID"
        Case Else: GetFieldTypeName = "Unknown (" & typeCode & ")"
    End Select
End Function
David Semon  @Reply  
      
11 months ago
Thanks, Juan.  Appreciate the code.
Juan Rivera  @Reply  
            
11 months ago
let me know how it works for you
David Semon  @Reply  
      
11 months ago
It works fine.  I  want to tweak it a bit to see what else I can do with the idea.
Juan Rivera  @Reply  
            
11 months ago
Go for it show us what you can do..... we all learn from each other.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/6/2026 4:14:18 PM. PLT: 1s