JasonPurdueEE
Technical User
Hello. I had to change some code when we upgraded to Access 2K (from Access 97). the only bit I cant figure out is my table def. it will run, but it will not create the fields. heres the relivant code:
**************************************************
Dim dbs As Database, tdf As TableDef, tdf2 As TableDef, fld As Field, fld2 as Field
Set dbs = CurrentDb
Set tdf = dbs.CreateTableDef("workpack"
Set fld = tdf.CreateField("PWR", dbText, 20)
tdf.Fields.Append fld
Set tdf2 = dbs.CreateTableDef("workpack"
Set fld2 = tdf2.CreateField("Phase", dbLong, 20)
tdf2.Fields.Append fld2
**************************************************
the table I want appended is "workpack"
the fields I want added are "PWR" and "Phase"
Anybody see where I'm going wrong here? Thanks in advance.
JASON
**************************************************
Dim dbs As Database, tdf As TableDef, tdf2 As TableDef, fld As Field, fld2 as Field
Set dbs = CurrentDb
Set tdf = dbs.CreateTableDef("workpack"
Set fld = tdf.CreateField("PWR", dbText, 20)
tdf.Fields.Append fld
Set tdf2 = dbs.CreateTableDef("workpack"
Set fld2 = tdf2.CreateField("Phase", dbLong, 20)
tdf2.Fields.Append fld2
**************************************************
the table I want appended is "workpack"
the fields I want added are "PWR" and "Phase"
Anybody see where I'm going wrong here? Thanks in advance.
JASON