In ADOX, you turn the field into an autonumber by setting the AutoIncrement
property of the column:
tbl12.Columns("Id").Properties("Autoincrement") = True
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"A" <al**@mail.com> wrote in message
news:dd**********@ctb-nnrp2.saix.net...
Hi
I can set "ID" (see below) as primary but how do I set it as a primary as
well as Auto
cat1.Tables.Append tbl12
Set idx1 = Nothing
Set tbl12 = Nothing
Set tbl12 = cat1.Tables("BdMaster")
idx1.Name = "Id"
idx1.PrimaryKey = True
idx1.Unique = True
idx1.Columns.Append ("Id")
tbl12.Indexes.Append idx1