Adding a table description through code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am creating a table through code, and am trying to add a description as
well. Help referenced the CreateProperty method, but I am unable to find any
mention of table descriptions.

Can someone point me in the right direction?
 
Public Sub AddDescription()

Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim prp As DAO.Property

Set db = CurrentDb
Set tdf = db.TableDefs("tblTest")
Set prp = tdf.CreateProperty("Description", dbText, "This is my
description")
tdf.Properties.Append prp

End Sub
 
Awesome.

Worked perfectly; thank you.

Brendan Reynolds said:
Public Sub AddDescription()

Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim prp As DAO.Property

Set db = CurrentDb
Set tdf = db.TableDefs("tblTest")
Set prp = tdf.CreateProperty("Description", dbText, "This is my
description")
tdf.Properties.Append prp

End Sub
 
Back
Top