AddFieldTable




Dim TempField as New Field
Dim db as Database
Const DBName$ = "youre database path and name "
const TbaleName$ ="youre table name"
Set db = Opendatabase(DBName$)
TempField.Name="nameoffyourenewfield"
TempField.Type = 4
db.TableDefs(TableName).Fields.Append TempField
db.Close
'TempField.Type means the kind of field:

'in this case 4 = long

'Do you want a textfield then use

'TempField.Type = 10

'TempField.Size = 15 (= length of the field)

'See also the helpfile on Fields Collection











( addfieldtable.html )- by Paolo Puglisi - Modifica del 17/12/2023