Is there a way to retrieve table descriptions?

Joined
Apr 29, 2008
Messages
66
Reaction score
0
I would find it useful to be able to retrieve, and possibly modify, all descriptions of tables and queries as an aid to documentation of my database. I haven't been able to find any way of doing this through the system tables. It looks as if they aren't held in the same way that other table details are in the system tables, especially as you maintain them differently from other table details. Is there any way of getting at them via a query or programmatically that anyone knows of?
 
Joined
Apr 29, 2008
Messages
66
Reaction score
0
I've found the answer to this myself. It is to use the DAO TableDefs collection. The following code lists all tables with descriptions where available.

Sub GetTableDescriptions()
Dim db As Database
Dim tdfTable As TableDef
Dim strDesc As String
Set db = CurrentDb
On Error Resume Next
For Each tdfTable In db.TableDefs
strDesc = ""
strDesc = tdfTable.Properties("Description")
Debug.Print tdfTable.name & " " & strDesc
Next
End Sub

If no description has been entered, there is no Description property which is why On Error Resume Next is needed.
I hope others find this helpful.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top