Table Field Properties Assistance

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have to display the Description of a Field in my Table. Not the name of
the field, but the Description I have given that Field Name.

Ihave this routine, but it just gives me the Field Name. What do I need to
do to get the Description?

IX = 0
NoFlds = rstI.Fields.Count
Do Until IX = NoFlds
MsgBox rstI.Fields(IX).Name
IX = IX + 1
Loop

Any help is greatly appreciated.

Thank You!

Granny
 
..value gives me the contents of the field, not the Description of the Field.

Thanks for trying to help!
 
GrandMaMa said:
I have to display the Description of a Field in my Table. Not the name of
the field, but the Description I have given that Field Name.

Ihave this routine, but it just gives me the Field Name. What do I need to
do to get the Description?

IX = 0
NoFlds = rstI.Fields.Count
Do Until IX = NoFlds
MsgBox rstI.Fields(IX).Name
IX = IX + 1
Loop


That's a little tricky because the Description property does
not exist if you don't type something into it in table
design view. Try something like:

Dim fld As Field
Dim strDescr As String
On Error Resume Next
For Each fld In rstI.Fields
strDescr = "<blank>"
strDescr = fld.Description
MsgBoxfls.Name & " - " strDescr
Next fld
 
Marshall Barton said:
That's a little tricky because the Description property does
not exist if you don't type something into it in table
design view. Try something like:

Dim fld As Field
Dim strDescr As String
On Error Resume Next
For Each fld In rstI.Fields
strDescr = "<blank>"
strDescr = fld.Description
MsgBoxfls.Name & " - " strDescr
Next fld

On the strDescr = fld.Description I get a "Field or Data Member Not Found
Message"

There are descriptions on every field in the Table Design View.

I have worked on this full time since July 1 (worked all weekend) and am
still struggeling with it. I am begining to wonder if it can be done?

Thanks for the help!
 
GrandMaMa said:
On the strDescr = fld.Description I get a "Field or Data Member Not Found
Message"

There are descriptions on every field in the Table Design View.

I have worked on this full time since July 1 (worked all weekend) and am
still struggeling with it. I am begining to wonder if it can be done?


Sure it can be done (using DAO). It's not that unusual.

That errro is to be expected for a field that does not have
a description. That's why I used On Error Resume Next
before the loop to avoid the expected error message.

If you still can't get it to work, post a Copy/Paste of the
pertinate parts of your code so I can double check it.
 
This syntax seems to work
rstI.Fields(IX).Properties("Description")
where
rstI.Fields(IX).Description
doesn't.

As Marsh said, the description has to exist before you can refer to it;
otherwise you'll get (I think) error 3270 Property not found.
 
Arrggghhhh, I forgot about explicitly using the Properties
property.

A good thing you caught my omission, John.
 
Back
Top