here is part of the code when creating an blank db in access and I got an error type mismatch on controlnum column and I can't seem to see why it occurred.
Thanks in advance.
Dim TableCheckBook As TableDef
Dim WrkSpce As Workspace
Dim DBEng As DBEngine
Dim Fld As Field
Dim Indx As Index
Set WrkSpce = DBEngine.Workspaces(0)
Set DB = CreateDatabase(DBName, dbLangGeneral)
Set TableCheckBook = DB.CreateTableDef("CheckBook"
Set Indx = TableCheckBook.CreateIndex("ControlNumIDX"
Indx.Primary = True
Indx.Fields.Append Indx.CreateField("ControlNum"
TableCheckBook.Indexes.Append Indx
Set Fld = TableCheckBook.CreateField("ControlNum", dblong)
Fld.Attributes = dbAutoIncrField
TableCheckBook.Fields.Append Fld
Set Fld = TableCheckBook.CreateField("Date", dbDate)
TableCheckBook.Fields.Append Fld
Set Fld = TableCheckBook.CreateField("Amount", dbCurrency)
TableCheckBook.Fields.Append Fld
Set Fld = TableCheckBook.CreateField("TransactionType", dbSingle)
TableCheckBook.Fields.Append Fld
Set Fld = TableCheckBook.CreateField("CheckNum", dbLong)
Fld.Attributes = dbVariableField
TableCheckBook.Fields.Append Fld
Set Fld = TableCheckBook.CreateField("UserID", dbText, 30)
TableCheckBook.Fields.Append Fld
DB.TableDefs.Append TableCheckBook
Thanks in advance.
Dim TableCheckBook As TableDef
Dim WrkSpce As Workspace
Dim DBEng As DBEngine
Dim Fld As Field
Dim Indx As Index
Set WrkSpce = DBEngine.Workspaces(0)
Set DB = CreateDatabase(DBName, dbLangGeneral)
Set TableCheckBook = DB.CreateTableDef("CheckBook"
Set Indx = TableCheckBook.CreateIndex("ControlNumIDX"
Indx.Primary = True
Indx.Fields.Append Indx.CreateField("ControlNum"
TableCheckBook.Indexes.Append Indx
Set Fld = TableCheckBook.CreateField("ControlNum", dblong)
Fld.Attributes = dbAutoIncrField
TableCheckBook.Fields.Append Fld
Set Fld = TableCheckBook.CreateField("Date", dbDate)
TableCheckBook.Fields.Append Fld
Set Fld = TableCheckBook.CreateField("Amount", dbCurrency)
TableCheckBook.Fields.Append Fld
Set Fld = TableCheckBook.CreateField("TransactionType", dbSingle)
TableCheckBook.Fields.Append Fld
Set Fld = TableCheckBook.CreateField("CheckNum", dbLong)
Fld.Attributes = dbVariableField
TableCheckBook.Fields.Append Fld
Set Fld = TableCheckBook.CreateField("UserID", dbText, 30)
TableCheckBook.Fields.Append Fld
DB.TableDefs.Append TableCheckBook