>All I am trying to do is to copy a previous record into a new one - more like
>prefilling a form based on the values of the previous record. I added a
[quoted text clipped - 7 lines]
>
>Thanks a million!
Please post the wizard code. That shouldn't be happening! What's the
Primary Key of the table? Are you assigning a new value for the new
record?
John W. Vinson[MVP]
Michelle K - 04 Feb 2005 12:53 GMT
This is the code behind the button. The primary key is called MainIndex and
when I look at the form in the datasheet view (I even went ahead and
displayed the primary key on the form), they are completely separate. It's
totally driving me nuts! It's not supposed to be rocket science!
Thanks. Just venting and quite frustrated.
Private Sub cdmDuplicate_Click()
On Error GoTo Err_cdmDuplicate_Click
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdPasteAppend
Exit_cdmDuplicate_Click:
Exit Sub
Err_cdmDuplicate_Click:
MsgBox Err.Description
Resume Exit_cdmDuplicate_Click
End Sub
> >All I am trying to do is to copy a previous record into a new one - more like
> >prefilling a form based on the values of the previous record. I added a
[quoted text clipped - 13 lines]
>
> John W. Vinson[MVP]