Results 1 to 2 of 2
  1. #1
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398

    Lightbulb Using ADO, entering the table property description

    Hello, I'm trying to use DAO to update within the table properties, the description. This is what I have so far. I haven't tried to run any of this code.


    Function ModifyTablePropertyDescription(strArchiveTable As String, strTableDescription As String)
    Dim db As DAO.Database
    Dim tdf As DAO.TableDef
    Dim fld As DAO.Properties


    Set db = CurrentDb()

    Set tdf = db.TableDefs(strArchivetable)



    Set fld = Nothing
    Set tdf = Nothing
    Set db = Nothing
    End Function

  2. #2
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    I solved the problem. Here is the working code.

    Sub ModifyTablePropertyDescription(strArchiveTable As String, strTableDescription As String)
    Dim db As DAO.Database
    Dim tdf As TableDef
    Dim prp As DAO.Property

    Set db = CurrentDb()

    Set tdf = db.TableDefs(strArchiveTable)

    On Error Resume Next
    tdf.Properties("Description") = strTableDescription

    If Err.Number = 3270 Then
    Set prp = tdf.CreateProperty("Description", _
    dbText, "Please don't ignore this error")
    tdf.Properties.Append prp
    End If

    Set prp = Nothing
    Set tdf = Nothing
    Set db = Nothing
    End Sub

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 06-20-2013, 10:26 PM
  2. Replies: 1
    Last Post: 12-10-2012, 07:04 AM
  3. Replies: 3
    Last Post: 03-11-2012, 08:20 AM
  4. Replies: 1
    Last Post: 08-17-2011, 11:13 AM
  5. Percent in a table; entering it via a form
    By DecaturLady in forum Access
    Replies: 11
    Last Post: 08-04-2011, 07:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums