Access 2003
Cannot Add a field to a table using VBA.
The table named "Table_Source_1" is already in existence.
The code below has no error message, however it did
not create the field.
///////////////////////////////////////////////
Private Sub Add_A_Field_To_The_Source_Table()
Dim Tdf_Source_Table As TableDef
Dim Field_Done As Field
Dim Dbs As Database
Set Dbs = CurrentDb
Set Tdf_Source_Table = Dbs.CreateTableDef("Table_Source_1")
Set Field_Done = Tdf_Source_Table.CreateField("Done", dbText)
Field_Done.Size = 3
Tdf_Source_Table.Fields.Append Field_Done
Dbs.Close
End Sub
Cannot Add a field to a table using VBA.
The table named "Table_Source_1" is already in existence.
The code below has no error message, however it did
not create the field.
///////////////////////////////////////////////
Private Sub Add_A_Field_To_The_Source_Table()
Dim Tdf_Source_Table As TableDef
Dim Field_Done As Field
Dim Dbs As Database
Set Dbs = CurrentDb
Set Tdf_Source_Table = Dbs.CreateTableDef("Table_Source_1")
Set Field_Done = Tdf_Source_Table.CreateField("Done", dbText)
Field_Done.Size = 3
Tdf_Source_Table.Fields.Append Field_Done
Dbs.Close
End Sub