Im trying to convert an existing autonumber field into a numeric long field.
How can I do this in VBA?
What I have tried:
The commented lines all fail with error 3219: Invalid Operation, with the exeption of the last one, which has no effect.
How can I do this in VBA?
What I have tried:
Code:
Dim DB As dao.Database Set DB = CurrentDb() Dim tblDef As dao.TableDef Set tblDef = DB.TableDefs("hist_Tbl_Obs") Dim f As dao.Field Dim p As Property For Each f In tblDef.Fields If f.Attributes And dbAutoIncrField Then Debug.Print f.Name 'f.Attributes = dbFixedField Or dbUpdatableField 'f.Attributes = dbNumeric 'f.Attributes=0 'f.Type = dbNumeric 'f.Properties(dbAutoIncrField) = False End If Next 'Cleanup Set f = Nothing Set tblDef = Nothing Set DB = Nothing
Comment