G
Guest
I am trying to script removal of a field from a BE:
Dim FilePath as String
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim tblName As String
Dim fldName As String
FilePath = <Path to DB>
tblName = "Table1"
fldName = "Field1"
Set db = DBEngine.Workspaces(0).OpenDatabase(FilePath, True)
Set tdf = db.TableDefs(tblName)
tdf.Fields.Delete fldName
However, Table1.Field1 Indexed property is Yes (No duplicates), so it fails
on the last line. I have checked the Indexes collection and find none for
that field. How can I change that field to Indexed: "No" so that I can then
delete it (or force-delete it without that)?
Dim FilePath as String
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim tblName As String
Dim fldName As String
FilePath = <Path to DB>
tblName = "Table1"
fldName = "Field1"
Set db = DBEngine.Workspaces(0).OpenDatabase(FilePath, True)
Set tdf = db.TableDefs(tblName)
tdf.Fields.Delete fldName
However, Table1.Field1 Indexed property is Yes (No duplicates), so it fails
on the last line. I have checked the Indexes collection and find none for
that field. How can I change that field to Indexed: "No" so that I can then
delete it (or force-delete it without that)?