Table Description

edwarric1

Registered User.
Local time
Today, 14:14
Joined
Feb 17, 2009
Messages
10
I use the following code to update the table description.

TDef.Properties.Append .CreateProperty("Description", dbText, Right(.Connect, Len(.Connect) - 1) & "; TABLE=" & .SourceTableName)

but if it already exists It will not overwrite! How can I delete it first?
 
Check to see if it exists first, if so skip over the create part.
 
yes but if it exists I want to over write it but cannot code it!
 
Several ways to skin this cat. One way is to delete and re-create it everytime:

CurrentDb.TableDefs("MyTableName").Properties.Delete("description")

Edit:

Something like this:

Code:
Private Sub Command0_Click()
On Error GoTo err_Command0_Click

    'Attempts to delete the description property
    CurrentDb.TableDefs("MyTableName").Properties.Delete ("description")
    
    'Put code here to create the property



exit_Command0_Click:
    Exit Sub
    

err_Command0_Click:
    If Err.Number = 3265 Then
        Resume Next
    End If

End Sub
 
Last edited:

Users who are viewing this thread

Back
Top Bottom