Copy Paste form Record (1 Viewer)

syedadnan

Access Lover
Local time
Today, 22:08
Joined
Mar 27, 2013
Messages
315
Regards,

Me using access 2010, i need a VBA to copy all records from the current row and paste in new record. I will use "on exit event" of form last field that will copy current and will paste in new row. looking for vba
 

missinglinq

AWF VIP
Local time
Today, 14:08
Joined
Jun 20, 2003
Messages
6,423
Assuming that "all records from the current row" actually means all Fields from the current Record, the code would be
Code:
DoCmd.RunCommand acCmdSaveRecord
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.GoToRecord , , acNewRec
DoCmd.RunCommand acCmdPasteAppend
But you have to be careful about how you're triggering this! You assume that the user will fill in the Controls, on the Form, in the same order that you would, but as the old song says...It Ain't Necessarily So! Users may have different ideas about the order they use and you could get the current record saved, without all needed data, and this incomplete record copied to a new record, as well!

Linq ;0)>
 

Users who are viewing this thread

Top Bottom