Function strGetTableDesc(strTable As String) As String
On Error Resume Next
'Purpose: Get the description for a linked table from the B/E DB.
'Some Info: I used the 'msysobjects' table to grab the path to the B/E db and also to grab the
'name of the foreign table name. Just in case a different name is used for the linked table name.
Dim strDesc As String
Dim db As Database
Dim strDb As String
Dim strForeignTblName As String
strDb = DLookup("Database", "msysobjects", "Name=" & Chr(34) & strTable & Chr(34)) 'Path to B/E DB
strForeignTblName = DLookup("ForeignName", "msysobjects", "Name=" & Chr(34) & strTable & Chr(34)) Name of table in External DB
If Len(strDb) = 0 Then 'Local table.
Set db = currentdb
strDesc = db.TableDefs(strTable).Properties("Description").value
Else
Set db = DBEngine.OpenDatabase(strDb) 'Linked Table
strDesc = db.TableDefs(strForeignTblName).Properties("Description").value 'Linked Tables
End If
strGetTableDesc = strDesc
If Not db Is Nothing Then Set db = Nothing
End Function