|
Private Sub AddField_Click()
Dim dbs As Database
Dim tdf As TableDef
Dim fld1 As Field, fld2 As Field, fld3 As Field, fld4 As Field, fld5 As Field, fld6 As Field, fld7 As Field
Set dbs = CurrentDb
Set tdf = dbs.TableDefs("runapp")
Set fld1 = tdf.CreateField("RunNo", dbText, 6)
Set fld2 = tdf.CreateField("DimCust", dbText, 6)
Set fld3 = tdf.CreateField("DimProd", dbText, 6)
Set fld4 = tdf.CreateField("DimCost", dbText, 6)
Set fld5 = tdf.CreateField("DimInter", dbText, 6)
Set fld6 = tdf.CreateField("Curr", dbText, 6)
Set fld7 = tdf.CreateField("Dim5", dbText, 6)
tdf.Fields.Append fld1
tdf.Fields.Append fld2
tdf.Fields.Append fld3
tdf.Fields.Append fld4
tdf.Fields.Append fld5
tdf.Fields.Append fld6
tdf.Fields.Append fld7
dbs.TableDefs.Refresh
Set dbs = Nothing
MsgBox "OK"
End Sub
|
|