一、函数:
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("表名称","字段名")