Set lfld = ltdfDestination.CreateField("temptable1_id", dbLong)
lfld.Attributes = dbAutoIncrField
ltdfDestination.Fields.Append lfldDestination
This attribute must be set before the field is appended
(david)
"jeff" <jeff[ at ]work> wrote in message news:%23OxkmwSiGHA.3496[ at ]TK2MSFTNGP02.phx.gbl...
[Quoted Text] > Hi gurus! > > I am using code to generate 2 related temporary tables. I want to use an > Autonumber field in the first which is used as the Foreign Key in the > second. > > How do I create the field definition using the FieldDefs objects to be an > AutoNumber Field type. I can do the following:- > > > Set ltdfDestination = mDb.CreateTableDef("temptable1") > Set lfldDestination = ltdfDestination.CreateField("temptable1_id", > dbLong) > ltdfDestination.Fields.Append lfldDestination > > I want to make the temptable1_id field an AutoNumber field. > > Any ideas? > > cheers > Jeff >
|