RaunLGoode
Registered User.
- Local time
- Today, 06:20
- Joined
- Feb 18, 2004
- Messages
- 122
I use Access 2000 on a Win2K box.
I have a form with seven fields. It is a pain to fill out because the values consist of long strings of alphanumeric characters. (I have no control over this) Frequently only one or two values change so I would like to let the user duplicate a previous record and change one or two fields, avoiding redundant data entry
The problem is; if I select the "Duplicate Record" command, and try to move to a new field with my mouse, I get the following error:
"The changes you requested to the table were not successful because they would create duplicate values in the index primary index or relationship…"
If the Tab or Enter key is hit before using the mouse everything works fine. Access does not let me save the duplicate record unless I change a value to make the record unique. The simplest solution seems to be embedding a Tab or Enter action at the end of the code generated for the Duplicate Record command. I can't figure out how to do that? I have enclosed the basic code for the Delicate Record command with where I think the Tab or Enter action should occur
Private Sub cmdCopyRec_Click()
On Error GoTo Err_cmdCopyRec_Click
DoCmd.GoToRecord , , acNewRec
Exit_cmdCopyRec_Click:
Exit Sub
Err_cmdCopyRec_Click:
MsgBox Err.Description
Resume Exit_cmdCopyRec_Click
[This is where I think the Tab or Enter action should occur]
End Sub
Thanks,
I have a form with seven fields. It is a pain to fill out because the values consist of long strings of alphanumeric characters. (I have no control over this) Frequently only one or two values change so I would like to let the user duplicate a previous record and change one or two fields, avoiding redundant data entry
The problem is; if I select the "Duplicate Record" command, and try to move to a new field with my mouse, I get the following error:
"The changes you requested to the table were not successful because they would create duplicate values in the index primary index or relationship…"
If the Tab or Enter key is hit before using the mouse everything works fine. Access does not let me save the duplicate record unless I change a value to make the record unique. The simplest solution seems to be embedding a Tab or Enter action at the end of the code generated for the Duplicate Record command. I can't figure out how to do that? I have enclosed the basic code for the Delicate Record command with where I think the Tab or Enter action should occur
Private Sub cmdCopyRec_Click()
On Error GoTo Err_cmdCopyRec_Click
DoCmd.GoToRecord , , acNewRec
Exit_cmdCopyRec_Click:
Exit Sub
Err_cmdCopyRec_Click:
MsgBox Err.Description
Resume Exit_cmdCopyRec_Click
[This is where I think the Tab or Enter action should occur]
End Sub
Thanks,