By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,476 Members | 889 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,476 IT Pros & Developers. It's quick & easy.

Save Update to a current record as a NEW RECORD

P: 51
I have a form that allow users to view the record, make update to the record, but then I want to allow user to save the update as a NEW RECORD. this is my code, and I need help.

doCmd.save "frmReview",,acNewRec
doCmd.close acform, "frmReview"

thanks!
Aug 20 '08 #1
Share this Question
Share on Google+
1 Reply


missinglinq
Expert 2.5K+
P: 3,532
You really can't do this in Access. You'll need to copy the current record data to a new record, then change the data as needed, being sure to change the data in any fields that have to be unique, such as the Primary Key, if it's not an AutoNumber.

Here's some simple code to copy the record; Place a command button on your form and name it cmdCopyRecord.

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdCopyRecord_Click()
  2.   DoCmd.RunCommand acCmdSelectRecord
  3.   DoCmd.RunCommand acCmdCopy
  4.   DoCmd.GoToRecord , , acNewRec
  5.   DoCmd.RunCommand acCmdPaste
  6. End Sub
  7.  
Linq ;0)>
Aug 20 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.