Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2006

    Unanswered: Table Properties Description

    In the Tables window with view set to details you have the following headers (Name, Description, Modified, Created and Type)

    If you right click on the table you can change the description in properties.

    Does anyone know how to do this in VB??

  2. #2
    Join Date
    Feb 2006
    see this kb article at

  3. #3
    Join Date
    Jan 2006
    Cheers for the article - Though I can't see how to alter that to meet my needs.

    That article relates to the database properties rather than the properties of an individual table.....

  4. #4
    Join Date
    Feb 2006
    Hey my friend,

    Sorry for the delay in posting. I was swamped by meetings all day. Try this.

    This works from a VBA perspective in Access.

    1. Create a command button. In the on-click event put the following:

    Private Sub CommandBtn_Click()
    TableDefDescription ("T_ADMIN")
    End Sub

    Create a function called TableDefDescription:

    Function TableDefDescription(ByVal TestTable As String)
    Dim DB As Database
    Dim TD As TableDef
    Dim P

    On Error GoTo err_trap

    'set database and tabledef variables
    Set DB = CurrentDb()
    Set TD = DB.TableDefs(TestTable)

    'see if a value exists
    TableDefDescription = TD.Properties("Description")

    'to delete the description field
    'TD.Properties.Delete ("description")

    'if not, trap the error and append the property to the table
    If Err.Number = 3270 Then
    Set P = TD.CreateProperty("Description", dbText)
    P.Value = "whadda yamean???"
    TD.Properties.Append P
    End If
    Exit Function

    MsgBox TableDefDescription
    End Function

    Its not pretty code, but it should work. Again, my apologies for the delay in responding. I hope it works for you.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts