Well, here's one way. Create a function in a General Module like this:
Public Function DuplicateRecord()
On Error GoTo Err_duplicateRecord
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append
Exit_duplicateRecord:
Exit Function
Err_duplicateRecord:
MsgBox Err.Description
Resume Exit_duplicateRecord
End Function
Then create a Macro with RunCode in the Action and DuplicateRecord() as the
Function
Now, right-click on the toolbar you want the button on and choose Customize.
In the Categories box, choose All Macros. Then in the Commands box, choose
the macro you just created and drag it to the toolbar. Before closing the
Customize box, right-click on the new button and choose Change Button Image
in the dropdown box and change the button image to a smiley face.
--
--Roger Carlson
MS Access MVP
Access Database Samples:
www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L