Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Caption Text 2

Status
Not open for further replies.

JohnTulley

Programmer
Jan 27, 2004
4
GB
Could anyone show / explain how I can read the Caption text of the Field properties of a table in VBA, preferably using a recordset.
Any help would be greatfully received.
 
msgbox myRs.Fields("Name").value

or
msgbox myRs.Fields(1)value
 
Hi JohnTulley,

If a Table Field has a Caption, then the Field in a Recordset based on it should inherit the Caption. To get it I think you need to index into the Properties Collection ..

Code:
Code:
RecordsetName
Code:
.Fields("
Code:
FieldName
Code:
").Properties("Caption")

But note that if the Field doesn't have a Caption, the Property won't exist so you will get an error if you try to reference it.

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top