I need a sql statement that will allow me to move data from one table to another (not copy but move) currently I am using the following code
Code:
Dim db As Database
Set db = CurrentDb
db.Execute "Insert INTO archive SELECT * FROM Main"
db.Execute "DELETE FROM [Main]"
However it seems to have some issues because it wants to delete the records before everthing is moved. I have another option which is:
Code:
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryArchive"
DoCmd.SetWarnings True
with a query of:
Code:
Insert INTO archive SELECT * FROM Main
DELETE FROM [Main]
But I dont know if this will guarentee a correct transfer of the data either.
Any Suggestions?