Save Update to a current record as a NEW RECORD

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • elainenguyen
    New Member
    • Oct 2006
    • 51

    Save Update to a current record as a NEW RECORD

    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",,ac NewRec
    doCmd.close acform, "frmReview"

    thanks!
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    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.

    Code:
    Private Sub cmdCopyRecord_Click()
      DoCmd.RunCommand acCmdSelectRecord
      DoCmd.RunCommand acCmdCopy
      DoCmd.GoToRecord , , acNewRec
      DoCmd.RunCommand acCmdPaste
    End Sub
    Linq ;0)>

    Comment

    Working...