Extract data from table and exporting it to other table (1 Viewer)

mcdhappy80

Registered User.
Local time
Today, 15:05
Joined
Jun 22, 2009
Messages
347
Here's the scenario.
I have a table that is populated with data.
In the meantime I've added one (and maybe I will be a couple of more fields).
I tried using some of the import/export features of access, and the one that really worked was with excel (I tried append data option but it didn't work I guess because the new table has one new field).
What I was thinking of (and need Your help with it) is to use VBA code to extract the data from the table and store it in the record set and then use that same records set to populate the new table.
Of course, because the table has new fields I would add lines of code that would consider that new fields but populate them with blanks.
That was the idea, maybe there is some other easier way, and if there is please share it here.
I just wanted to avoid configuring tables again after I create (import) them with the old data.
One other thing crossed my mind right now. Will there be no problems if I export Autonumber fields and then try to import the values to autonumber field as well?

Thank You
 

DJkarl

Registered User.
Local time
Today, 09:05
Joined
Mar 16, 2007
Messages
1,028
Sounds like a simple SQL append query is all you need

Code:
INSERT INTO DestTable ( Field1, Field2 ,Field3)
SELECT SourceTable.Field1, SourceTable.Field2, '' as Field3
FROM SourceTable;
 

Users who are viewing this thread

Top Bottom