retrieving field description property

G

Guest

I have a control on a form where I change the StatusBarText when AllowEdits =
True. How do I retrieve the default StatusBarText when AllowEdits = False?
Description (in the table definition) does not seem to be available as a
property for the underlying field. Is there a way to do this short of
hard-coding the text into the program?

Thank you in advance,
Oli
04.23.06 15.27 hst
 
M

Marshall Barton

UncleOli said:
I have a control on a form where I change the StatusBarText when AllowEdits =
True. How do I retrieve the default StatusBarText when AllowEdits = False?
Description (in the table definition) does not seem to be available as a
property for the underlying field. Is there a way to do this short of
hard-coding the text into the program?


Important note: This is one of Access custom properties.
It will not exist if you do not enter something into the
field's Description property. You need to use error
trapping to deal with this situation.

The controls on a form do not pick up these custom
properties once the form is created, but you can get it
from:

CurrentDb.TableDefs!yourtable.Fields!yourfield.Properties!Description

But, it also seems to be available through the form's
recordset so you do not have to embed the table or field
name in your code:

Me.RecordsetClone.Fields(Me.controlname.ControlSource).Properties!Description
 

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