G
Gibson
I am simply trying to add a field to an existing backend table using the
following code. When I get to the last line to Append idx I receive an error
message "Invalid field definition "Field1 in definition of Index or
relationship. I think I am making this more difficult than it should be.
Can anybody see what I am doing wrong? Thank you.
Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)
Set Db = wrkJet.OpenDatabase("C:\Backend.MDB", True)
Set tdf = Db.TableDefs("tbl1")
Set idx = tdf.CreateIndex("Field1")
With idx
.Fields.Append .CreateField("Field1", dbText, 20)
End With
tdf.Indexes.Append idx
following code. When I get to the last line to Append idx I receive an error
message "Invalid field definition "Field1 in definition of Index or
relationship. I think I am making this more difficult than it should be.
Can anybody see what I am doing wrong? Thank you.
Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)
Set Db = wrkJet.OpenDatabase("C:\Backend.MDB", True)
Set tdf = Db.TableDefs("tbl1")
Set idx = tdf.CreateIndex("Field1")
With idx
.Fields.Append .CreateField("Field1", dbText, 20)
End With
tdf.Indexes.Append idx