Object Listing in MS Access 2000

R

Richard John

Does anyone know how to extract the Description property of the Objects in
each MS Access container ie. Tables, Queries etc... I've inserted
descriptions against 80% of the objects in a few databases (sort of
on-the-fly documentation). I can list out the names of the objects, no
sweat. However, I can't list the descriptions. I need all this for
documentation purposes.

Thanks
 
D

Douglas J. Steele

You need to open the object in design view, then refer to its Description
property. Unfortunately, the Description property doesn't exist unless you
add a description: if you try and refer to the property and there is no
description, an error is raised.

For tables and queries, there's no need to use the Container, though: simply
use the TableDefs and QueryDefs collections.
 
R

Richard John

Thanks very much, Douglas. Appreciate your helpful response. I really should
have looked deeper. I found this example in MS Access Help, which solves the
problem (code fragment slightly modifed to suit):

#########################################
Set dbs = CurrentDb
' Set Container object variable.
Set ctr = dbs.Containers(strObjectType)
' Set Document object variable.
Set doc = ctr.documents(strObjectName)

' Print each Object property to Debug window.
For Each prp In doc.Properties
Select Case prp.Name 'I adapted this part of the example. Just
wanted three properties
Case Is = "Name", "Container", "Description"
Debug.Print prp.Name & " = " & prp.Value
End Select
Next

#########################################

Thanks
 

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