I could just open the table in design view and add the text manually to the description column, but how can I do it programmatically?
I use the following code to change table field names programatically:
Private Sub cmdUpdateSuppliersTable_Cl
ick()
. . .
z = ChangeFieldName("tblSuppli
ers", "State Tax ID", "strStateTaxID")
. . .
End Sub
and. . .
Public Function ChangeFieldName(strTableNa
me As String, strOldFieldName As String, strNewFieldName As String)
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Set db = CurrentDb
Set tdf = db.TableDefs(strTableName)
tdf(strOldFieldName).Name = strNewFieldName
Set tdf = Nothing
Set db = Nothing
End Function
Start Free Trial