Hi,
I send yesterday this mail, but I don't think it passed.
A VBA Access code was perfectly working in Office 2003, but, now I change to Office 2013…
I search, but nothing I found on the net response exactly to my problem. Can you help me?
Here us the code:
Thanks,
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 Sub Create_MyTable: Set dbs = appAccess.CurrentDb sTableName = "MyTable" Set tdf = dbs.CreateTableDef(sTableName) With tdf .Fields.Append .CreateField("Id", dbLong) .Fields.Append .CreateField("IdOther", dbLong) Set idx = .CreateIndex("Id") idx.Fields.Append idx.CreateField("Id") idx.Primary = True .Indexes.Append idx End With Set fld = tdf.Fields("id") fld.Attributes = dbAutoIncrField *Here is the problem dbs.TableDefs.Append tdf End Sub
Alain.
Partager