RuslanBLR, вот там пост хороший, обрати внимание:
| Цитата | If you COPY the table and PASTE the "STRUCTURE ONLY" it deletes all of the data and resets any Autonumbers to 0.
If you have to do this automatically, run a DELETE QUERY, then "Docmd.CopyObject..." and it will reset the Tables Autonumbers to 0.
If You need the New table to have the same name, then use "DoCmd.Rename..." on the old table and when You Copy it Paste it with the Original name...
So your module could have 3 lines of code:
DoCmd.OpenQuery "ClearRecords" DoCmd.Rename "Newtable", acTable, "OriginalName" DoCmd.CopyObject , "OriginalName", acTable, "NewTable"
|
|