print out Table Description Property (and Field Descriptions)

L

Loralee

I am trying to create 2 report: A and B.

Report(A) contains the name and description for each of the tables in my
db, and then Report(B) that lists each each field name and description in
each table.

I am using Allison Balter's example in DAO and am getting an error that the
property ormethod is not available. I believe it is failing at the
description property. When I type in "tdf. " Intellisense does not show
description for tdf or any other variations I've tried. I don't want all the
properties the Documenter gives me, just a simple list so I can document and
share the definitions of the tables and fields. (Is the description property
hidden somewhere else?)

Thanks-
Loralee

******************
My code is:

Dim db As DAO.Database
Dim tdf As TableDef
Dim fld As Field

Set db = CurrentDb
DoCmd.SetWarnings False
For Each tdf In db.TableDefs
DoCmd.RunSQL "INSERT INTO tblTableDefs" _
& "(tableName, TableDesc) " _
& "VALUES (" & tdf.Name & ", " & tdf.Description & ")"
Next tdf

DoCmd.SetWarnings True
 
D

Douglas J. Steele

The Description property doesn't exist unless you've assigned a description
to the table or field.

That means that your code has to handle the error that will occur when you
refer to a non-existant description.

Your Error Handler should be something like:

EH:
Select Err.Number
Case 3270
Resume Next
Case Else
MsgBox Err.Number & ": " & Err.Description
Resume End_Routine
End Select
 
L

Loralee

Thanks- I just got back to working on this, and I added the recommended
errorhandling. When I run from the immediate window I am still getting a
compile error "method or datamember not found" and when I step through it is
the Description property (in line: & "VALUES (" & tdf.Name & ", " &
tdf.Description & ")" ) that is erroring/light up.

Do the description properties of tables and fields "live" elsewhere? Did I
write something else wrong?
Thanks,

Loralee
 

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