TableDef Description

J

Jay Myhre

In my tables I have entered documentation information in the "Description"
column. I wish to print that. So far I have been able to print the field
name, datatype, and size. How do I add the "Description"? I've tried
fld.Description and fld.Properties("Description") but neither works. The
Tools/Analyzer/Documenter doesn't give the option of including "Description".
This is what my code looks like.

For Each tbl In db.TableDefs
For Each fld In tbl.Fields
Debug.Print fld.Name
Debug.Print fld.Type
Debug.Print fld.Size
 
A

Allen Browne

See the TableInfo() function here:
http://allenbrowne.com/func-06.html

Access creates the Description property only when you fill a description in.
For fields that have no description, the property does not exist, so trying
to read the property generates an error.

The function above solves that problem by calling another little function to
read the Description if it exists, and recover from the error if it does
not.
 
J

Jay Myhre

Allen,
Thanks, that was exactly what I needed. I was close with
fld.Properties("Description"), just didn't know that it would create an error
if the field was blank.
Jay
 

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