K
kuhrty
I am trying to create a table using a module because the database will
only exist for it to process. It appears that the syntax is coded
correctly but I keep getting an error: Object Variable or With block
not set. I don't want to use the with block because I need to
eventually do late binding.
Any suggestion are appreciated.
Dim dbs As Database
Dim tdf As TableDef
Set tdf = dbs.CreateTableDef("tbl_RiskMK")
tdf.Fields.Append tdf.CreateField("Region", dbText)
tdf.Fields.Append tdf.CreateField("Sector", dbText)
tdf.Fields.Append tdf.CreateField("Business", dbText)
tdf.Fields.Append tdf.CreateField("EventCategory", dbText)
tdf.Fields.Append tdf.CreateField("Qtr_Yr", dbText)
tdf.Fields.Append tdf.CreateField("NetAmount_USD", dbDouble)
tdf.Fields.Append tdf.CreateField("EventRank", dbByte)
tdf.Fields.Append tdf.CreateField("BusinessRank", dbByte)
dbs.TableDefs.Append tdf
only exist for it to process. It appears that the syntax is coded
correctly but I keep getting an error: Object Variable or With block
not set. I don't want to use the with block because I need to
eventually do late binding.
Any suggestion are appreciated.
Dim dbs As Database
Dim tdf As TableDef
Set tdf = dbs.CreateTableDef("tbl_RiskMK")
tdf.Fields.Append tdf.CreateField("Region", dbText)
tdf.Fields.Append tdf.CreateField("Sector", dbText)
tdf.Fields.Append tdf.CreateField("Business", dbText)
tdf.Fields.Append tdf.CreateField("EventCategory", dbText)
tdf.Fields.Append tdf.CreateField("Qtr_Yr", dbText)
tdf.Fields.Append tdf.CreateField("NetAmount_USD", dbDouble)
tdf.Fields.Append tdf.CreateField("EventRank", dbByte)
tdf.Fields.Append tdf.CreateField("BusinessRank", dbByte)
dbs.TableDefs.Append tdf