Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004

    Unanswered: report of tables' fields

    Long ago I once used a query and some system table(s) to pull a list of field names per table, the field descriptions that were entered, and a few other basic field details like field size, required, etc. I can't recall now how to do this. I see only one possible relevant system table MySysObjects which has the tables but no field for each table and I don't see another sys table to link to for that info. Can anyone help? I don't want to use Access' canned report, which contains TONS of extraneous info., which I'd need to manual delete if I exported that report.

    Any ideas??? A link to a related article/page would also help.
    Thanks in advance.

  2. #2
    Join Date
    Jun 2004
    Terrapin Nation
    This needs some work but you should get the general idea:

    Function PrintObjectProperties(strObjectType As String, strObjectName _
    As String)

    Dim dBs As DAO.Database, ctr As Container, doc As Document
    Dim intI As Integer
    Dim strTabChar As String
    Dim prp As Property

    Set dBs = CurrentDb
    strTabChar = vbTab
    ' Set Container object variable.
    Set ctr = dBs.Containers(strObjectType)
    ' Set Document object variable.
    Set doc = ctr.Documents(strObjectName)
    ' Print the object name to Debug window.
    Debug.Print doc.Name
    ' Print each Object property to Debug window.
    For Each prp In doc.Properties
    If prp.Name = "Name" Or prp.Name = "Description" Then
    'MsgBox strTabChar & prp.Name & " = " & prp.Value
    Debug.Print strTabChar & prp.Name & " = " & prp.Value
    End If

    Debug.Print " "

    End Function

    A call the function might be like:

    Set dBs = CurrentDb
    'Set td = dBs.TableDefs

    For Each td In dBs.TableDefs

    PrintObjectProperties "Tables", td.Name

    Next td

  3. #3
    Join Date
    May 2004
    Thanks for the input. I also found a .mdb file someon did that will create a report for me. For anyone else interested, here's a link to forum with it:

    (I hope it's ok here to insert links/addresses to other forum pages?!)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts