U
Uni
Hi - I've seen many different posts regarding duplicating a record - I am
able to do this fine, however I do have a need to leave one of the fields
(Position.NewLineNo) blank so that the user can fill it in. This field is
not a primary key - I have a PositionID field which uses the autonumber
feature. Since my VBA skills are not very advanced I'm looking for a
solution to leave the field blank. I've included the code that I am using.
This code is using a cmd button with the OnClick() event:
Private Sub cmdDuplicateRecord_Click()
On Error GoTo Err_cmdDuplicateRecord_Click
DoCmd.RunCommand acCmdSaveRecord
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdPasteAppend
Exit_cmdDuplicateRecord_Click:
Exit Sub
Err_cmdDuplicateRecord_Click:
MsgBox Err.Description
Resume Exit_cmdDuplicateRecord_Click
End Sub
I'm sure there is a simple way to do this but I am not sure what it might be
Thanks in advance for any suggestions.
Uni
able to do this fine, however I do have a need to leave one of the fields
(Position.NewLineNo) blank so that the user can fill it in. This field is
not a primary key - I have a PositionID field which uses the autonumber
feature. Since my VBA skills are not very advanced I'm looking for a
solution to leave the field blank. I've included the code that I am using.
This code is using a cmd button with the OnClick() event:
Private Sub cmdDuplicateRecord_Click()
On Error GoTo Err_cmdDuplicateRecord_Click
DoCmd.RunCommand acCmdSaveRecord
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdPasteAppend
Exit_cmdDuplicateRecord_Click:
Exit Sub
Err_cmdDuplicateRecord_Click:
MsgBox Err.Description
Resume Exit_cmdDuplicateRecord_Click
End Sub
I'm sure there is a simple way to do this but I am not sure what it might be
Thanks in advance for any suggestions.
Uni