K
Keith
Hello,
I need to create a table and add fields. I tried the following text based
on an example in a book, and receive the error shown below. What would you
suggest to get the sub running?
Public Sub test()
Dim dbs1 As Database
Dim tdf1 As TableDef
Dim fld1 As Field
Set dbs1 = CurrentDb
Set tdf1 = dbs1.CreateTableDef("Data_File_Test")
Set fld1 = tdf1.CreateField("Test_Field_1", dbLong)
' error here is ... “No field defined.. cannot append Tabledef or Indexâ€
dbs1.TableDefs.Append tdf1
Debug.Print "done"
End Sub
I need to create a table and add fields. I tried the following text based
on an example in a book, and receive the error shown below. What would you
suggest to get the sub running?
Public Sub test()
Dim dbs1 As Database
Dim tdf1 As TableDef
Dim fld1 As Field
Set dbs1 = CurrentDb
Set tdf1 = dbs1.CreateTableDef("Data_File_Test")
Set fld1 = tdf1.CreateField("Test_Field_1", dbLong)
' error here is ... “No field defined.. cannot append Tabledef or Indexâ€
dbs1.TableDefs.Append tdf1
Debug.Print "done"
End Sub