Copy/paste records

Spricar

New member
Local time
Yesterday, 21:15
Joined
Mar 4, 2013
Messages
7
Hi!

I've got a big problem and can't solve it as I'm a complete access noob;)

I've got two databases, one from 2012 and one for 2013. All record for 2013 are entered, but I would like to add some from 2012 too (around 1000 records). So, is there any way I can add them, other than manually reentering them into 2013 database? Both tables are identical, that is, the one from 2013 is just 2012 which was erased and started anew. I have tried going into table view, copying the records (all 1000 rows) and pasting them into 2013 but it doesn't work. I've got the msg saying that
Letters are not allowed by the input mask: 99/99/00;0 (or something like that, I don't have an english version of MA...)

Any help would be MUCH appreciated!

thanks in advance
S.
 
The way you are trying to do it should work although you may have a problem depending on your indexed/autonumber fields.

To do this with a query it will something along these lines (replace table and field names as required):

Code:
INSERT INTO Tbl2013 ( Fld1, Fld2 )
SELECT Tbl2012.Fld1, Tbl2012.Fld2
FROM Tbl2012;

This will fail if any of the fields posted will create a duplicate index where duplicates are not allowed.

You may well need to extend the SQL to include a WHERE element to limit the records in 2012 to be brought through.

Also, you should not post the autonumber field (if you have one)
 
Hm, I'm afraid I don't quite get that... If I understand correctly this query would copy selected fields from database A into database B? What I need is:

Table in database A Table in database B
old values new values
old values new values
old values new values
old values new values
... ...
old values1 empty record
old values1 empty record
old values1 empty record
... .....

I want to copy/transfer all rows of old values in database A table into table in database B. This is some 1000 rows of, say, 20 columns..
 
Sorry, missed the 2 db issue.

The query will still work, but in your 2013 db create a linked table to the relevant table in your 2012 db. Assuming the table in the 2012 db has the same name as in the 2013 db Access will automatically append a 1 to the end of the table name.

Your query will then be something like:

Code:
INSERT INTO YourTbl ( Fld1, Fld2, Fld3, Fld4..... )
SELECT YourTbl1.Fld1, YourTbl1.Fld2, YourTbl1.Fld3, YourTbl1.Fld4.....
FROM YourTbl1;
 

Users who are viewing this thread

Back
Top Bottom