Use DAO to set Caption and Description properties as Andrea suggested. Just be aware that both Caption and Description are user-defined, not default properties ... meaning that they don't exist before you assign them a value.
For example the following statement triggers error 3270, 'Property not found', because I have not assigned a Description for the id field:
Debug.Print CurrentDb.TableDefs("tblFoo").Fields("id").Properties("Description")
In order to assign a Description value for the field, I would first have to CreateProperty
for "Description" then Append
the new property to the field's Properties
collection. Rather than write code to show you, I will suggest you use Allen Browne's SetPropertyDAO function. That function will handle the details for you. Be sure to grab the HasProperty
function, too, because it is called by SetPropertyDAO
. (The code for HasProperty
is on the same web page, immediately below the SetPropertyDAO
function code.)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…