Paste Append on last record?

branston

Registered User.
Local time
Today, 05:47
Joined
Apr 29, 2009
Messages
372
Hi!

Hopefully quite an easy one, but one that will be a bit of a disaster if i do it wrong! I have a database that is already in use (and therefore has a lot of data in) We are expanding a certain section of it and i need to copy and paste append some data into a table which already has 500+ records in it. I obviously dont want to overwrite any of the existing data, so would i say go to last record, add new record or what?

So far I have:

DoCmd.OpenTable "TblQuantities"
DoCmd.GoToRecord , , acLast
DoCmd.RunCommand acCmdPasteAppend
DoCmd.Close acTable, "TblQuantities"

but i thought i would run it past you guys before i try it out as i was worried it might overwrite the last record.

If you could put my mind at ease it would be greatly appreciated!!

Thank you!
 
make a copy of your table before experimenting.

i haven't checked the code you have so i won't say anything about it (i've never used acCmdPasteAppend), but i do think you want acNew, not acLast. (can you use an append query?)
 
Just use an append query. Your code is useless on a table.
 
Sorry, I should include more information. There is no DoCmd.GoToRecord to use on a table by opening the table like you are doing. You would need to do it differently (open the table in a recordset and iterate through, etc).

An append query is faster and much more efficient AND it APPENDS records - it does not overwrite existing records.
 
Thank you. Ive gone for the query option. Thank you!
 

Users who are viewing this thread

Back
Top Bottom