Hi,
I am trying to write a code to copy the current record as a new record (basicly, I would like to duplicate the current record). but then when I click on the command button, it didn't do anything. Here is my code:
Since I have problem with my code, I tried to use the "Duplicate Record" wizzard from access to write the code, but then when I test it, it gave me an error message: "The Command/Action "PasteAppen d" isn't available now".
here is the access wizzard code to duplicate record:
Anyone please help.
thanks!
I am trying to write a code to copy the current record as a new record (basicly, I would like to duplicate the current record). but then when I click on the command button, it didn't do anything. Here is my code:
Code:
DoCmd.RunCommand acCmdSelectRecord DoCmd.RunCommand acCmdCopy DoCmd.GoToRecord , , acNewRec DoCmd.RunCommand acCmdPaste
here is the access wizzard code to duplicate record:
Code:
Private Sub cmdDup_Click()
On Error GoTo Err_cmdDup_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70
Exit_cmdDup_Click:
Exit Sub
Err_cmdDup_Click:
MsgBox Err.Description
Resume Exit_cmdDup_Click
End Sub
thanks!
Comment