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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top