aftershokk
Registered User.
- Local time
- Today, 21:01
- Joined
- Sep 5, 2001
- Messages
- 259
Hi all!
I have a copy button on a patient entry screen that allows the user to copy the record in current view to a new record. When the copy is made it appears Access does append a new row and key to the table. However, when I start to edit the new record it reverts back to the original record I copied so I am now editing the original record instead of the new copied record?
Example:
current view
id 139 John Doe
copy command button to
new id 725 John Does
When I start to edit the name, I am actually editing id 139 instead of 725
I am assuming it it probably a line of 2 of code that can be added to keep the new record active on the form?
thanks!
VBA code below:
Private Sub copy_rec_command_button_Click()
On Error GoTo Err_copy_rec_command_button_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append
Exit_copy_rec_command_button_Click:
Exit Sub
Err_copy_rec_command_button_Click:
MsgBox Err.Description
Resume Exit_copy_rec_command_button_Click
I have a copy button on a patient entry screen that allows the user to copy the record in current view to a new record. When the copy is made it appears Access does append a new row and key to the table. However, when I start to edit the new record it reverts back to the original record I copied so I am now editing the original record instead of the new copied record?
Example:
current view
id 139 John Doe
copy command button to
new id 725 John Does
When I start to edit the name, I am actually editing id 139 instead of 725
I am assuming it it probably a line of 2 of code that can be added to keep the new record active on the form?
thanks!
VBA code below:
Private Sub copy_rec_command_button_Click()
On Error GoTo Err_copy_rec_command_button_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append
Exit_copy_rec_command_button_Click:
Exit Sub
Err_copy_rec_command_button_Click:
MsgBox Err.Description
Resume Exit_copy_rec_command_button_Click