table to table

senzor

Registered User.
Local time
Yesterday, 16:06
Joined
Feb 14, 2006
Messages
10
HElo
im working on a access database and i have 2 tables : test1 and test 2
They have the same columns.
My question is how can i copy the data of test1 to test2 , while using a module.
Thnx
 
That goes against normalization!

But to do it you would user a delete query to clear the table2 then use an append query to populate the table2 with the data from the other table1.
 
ghudson said:
That goes against normalization!

But to do it you would user a delete query to clear the table2 then use an append query to populate the table2 with the data from the other table1.
Yea its not normalized but im doing ma interm right now in a (pc)hardware store but there is no work anymore right now so im "upgrading" my VBA skills a bit :D
cause i need it
Sub macro2()

CurrentDb().Execute "DELETE * FROM cst_import"
CurrentDb().Execute "DELETE * FROM art_import"

CurrentDb().Execute "INSERT INTO CST_import ( SysNum,Name,crc_1,Crc_2,Crc_3,Crc_4,credate,cretime)SELECT CST.SysNum, CST.Name,cst.crc_1,cst.Crc_2,cst.Crc_3,cst.Crc_4,cst.credate,cst.cretime FROM CST"
CurrentDb().Execute "INSERT INTO ART_import ( Crc_1, Crc_2, Crc_3, Crc_4, CreDate, CreTime )SELECT ART.Crc_1, ART.Crc_2, ART.Crc_3, ART.Crc_4, ART.CreDate, ART.CreTime FROM ART"

End Sub
 
Using the CurrentDb().Execute commands shows you are on the right track.
 

Users who are viewing this thread

Back
Top Bottom