salut,
je partirais sur un rapide
CurrentDb.Execute "INSERT INTO NouvelleTable (...) SELECT (...) FROM MaTable"
les (...) représentant les différents champs.
Si jamais tu ne sais pas à l'avance leur nom, tu peux passer en amont par une variable string du type :
1 2 3 4 5 6 7 8 9 10 11 12
|
Dim ListeChamps as String
Dim tmpTable As TableDef
Dim i as Integer
ListeChamps = ""
Set tmpTable = CurrentDb.TableDefs("MaTable")
For i = 1 to tmpTable.Fields.Count
ListeChamps = ListeChamps & "[" & tmpTable.Fields(i).Name & "],"
Next i
'on supprime la virgule en trop à droite
ListeChamps =left(ListeChamps,Len(ListeChamps)-1)
CurrentDb.Execute "INSERT INTO NouvelleTable " & ListeChamps & " SELECT " & ListeChamps & " FROM MaTable" |
Partager