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!

Table Description retrieval

Status
Not open for further replies.

TheRealDeal

Technical User
Nov 16, 2001
187
US
Is it possible to return the Description of a Table for VBA? If so, how? I am wanting to use the Description of the table in a form to update the end-user about which table is being dynamically processed.
 
Try this function:
Code:
Public Function tableDescription(tableName As String) As String

    Dim Db As Database, Prp As Property
    Set Db = CurrentDb

    For Each Prp In Db.TableDefs(tableName).Properties
        If Prp.name = "Description" Then tableDescription = Prp.Value
    Next

    Db.Close
    Set Db = Nothing

End Function

For example, if the table MyTable has the Description as My Very Own Table, then:
Code:
?tableDescription("MyTable")
...will return: [tt]My Very Own Table[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top