HarrySpencer
Registered User.
- Local time
- Today, 14:57
- Joined
- Apr 10, 2007
- Messages
- 25
hi, i've found some code to copy info from one table to another but need to change it so that it will copy data from multiple tables, certain fields only, to a single table. it is a sort of archive function but won't be used very often so didn't think it was necessary to create 1 to many relationships for a load of tables. let me know if you can think of a better way or solution to this, here is the code i found about the forum...
is it possible to just run a variation for each table i want to copy FROM or will the INSERT INTO create a new record.
Code:
Dim strSQL As String
strSQL = "INSERT INTO PasteHere_tb([CopyID], [PasteName], [PasteDate], [PasteComments]) "
strSQL = strSQL & "SELECT CopyThis_tb.[CopyID], CopyThis_tb.[CopyName], CopyThis_tb.[CopyDate], CopyThis_tb.[CopyComments]"
strSQL = strSQL & "FROM [CopyThis_tb]"
strSQL = strSQL & "WHERE (((CopyThis_tb.[CopyID])=[Forms]![CopyThis_tb]![CopyID]));"
DoCmd.RunSQL strSQL
is it possible to just run a variation for each table i want to copy FROM or will the INSERT INTO create a new record.