很多情况下,我们为了兼容,表名和表字段等都是用英文来表示。而效果我们则用中文来显示标题。
一、函数:
Public Function GetFldCaption(TblName As String, FldName As String) As
String
On Error Resume Next
Dim rst As DAO.Recordset
Set
rst = CurrentDb().OpenRecordset(TblName)
GetFldCaption =
rst(FldName).Properties("Caption")
rst.Close
Set rst =
Nothing
End Function
二、调用方式:
msgbox GetFldCaption("表名称","字段名")