Object descriptions - Access 2010

Timtropolis

Registered User.
Local time
Today, 11:40
Joined
Jun 17, 2004
Messages
84
Greetings all,

I'm working on a large documentation project. I inherited several large Access db's (created in 2007, upscaled to 2010 prior to my inheriting them) and I need to print out each object and its associated description. I thought I could query one of the system tables to obtain this but I don't see this info stored there. Was wondering if there was a way to do this with VBA? Did several searches here on this site (as well as a few others and Google) but did not see anything of note.

Any help would be appreciated.

TIA,

Tim
 
Any reason you can't use the inbuild documenter?? Just mark all objects and print out, just load the printer with paper first and go for a cup of coffee ;-)

JR
 
In the case of the queries it generates over 100+ pages since it puts each query on a diff page (can't edit the report template) and gives me data I don't want. If I could get at the report template, I could do what I need.
 
Hey all,

Finally figured out the code for this and thought I'd post it, give back to the forum for all that I've gotten from it. This has worked really well for me and my documentation project and is certainly a big help, hope it is to you as well.

If anyone has any questions, please feel free to leave me a msg here.



Code:
'*** Use this code to extract object name and description from the Msys tables***

    On Error GoTo PROC_ERROR
    
    Dim dbs As DAO.Database
    Dim rst As DAO.Recordset
    Dim i As Integer
    Dim Qry_Name, Qry_Desc As String
    
    Set dbs = CurrentDb
    Set rst = dbs.OpenRecordset("InputTable", dbOpenDynaset) '--- table is used to house the information
    
    For i = 0 To CurrentDb.TableDefs.Count - 1 '--- tabledefs can be substituted with Querydefs, modules/allmodules, etc
    '--- These Left if statements are particular to my table structures, but ultimately can be used to weed out the system tables 
        If Left(CurrentDb.TableDefs(i).Name, 1) = "t" Or Left(CurrentDb.TableDefs(i).Name, 1) = "i" Or Left(CurrentDb.TableDefs(i).Name, 1) = "z" Then
            Qry_Name = CurrentDb.TableDefs(i).Name
            If IsNull(CurrentDb.TableDefs(i).Properties("Description")) Then
                Qry_Desc = ""
            Else
                Qry_Desc = CurrentDb.TableDefs(i).Properties("Description")
            End If
            rst.AddNew
            rst!objname = Qry_Name
            rst!objdesc = Qry_Desc
            rst.Update
        End If
    Next i
    
    MsgBox "all done"
    
    
PROC_ERROR:
    If Err.Number = 3270 Then  '--- if a description is blank, it will generate a 3270 error, so this processing is needed
        'Qry_Desc = ""
        Resume Next
    End If
 
Last edited:

Users who are viewing this thread

Back
Top Bottom