L
laurak
I am trying to copy a record in a table using a command
button on a form. The table has a primary key that is
auto numbered. When I use the button to copy and paste a
record, it creates a Paste Errors table. I believe it is
because of the auto number primary key. The vb code is as
follows:
Private Sub Copy_Record_Click()
On Error GoTo Err_Copy_Record_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, ,
acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, ,
acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, ,
acMenuVer70 'Paste Append
Exit_Copy_Record_Click:
Exit Sub
Err_Copy_Record_Click:
MsgBox Err.Description
Resume Exit_Copy_Record_Click
End Sub
Can anyone help? Thanks so much!!
button on a form. The table has a primary key that is
auto numbered. When I use the button to copy and paste a
record, it creates a Paste Errors table. I believe it is
because of the auto number primary key. The vb code is as
follows:
Private Sub Copy_Record_Click()
On Error GoTo Err_Copy_Record_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, ,
acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, ,
acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, ,
acMenuVer70 'Paste Append
Exit_Copy_Record_Click:
Exit Sub
Err_Copy_Record_Click:
MsgBox Err.Description
Resume Exit_Copy_Record_Click
End Sub
Can anyone help? Thanks so much!!