copy a record in a form to a new record

  • Thread starter Thread starter fedum
  • Start date Start date
F

fedum

Hi,
I would like to copy the actieve record on a form to a new
record. I tryed the code from MS-KB:
Private Sub Command1_Click()
Dim rs As DAO.Recordset
Set rs = Me.Recordset.Clone
rs.AddNew
rs!CustomerID = "AAAAA"
rs!CompanyName = "AAAAA Company"
rs.Update
End Sub
I have an unique field ProductId and Code. If I use this
code (change the fieldnames) then there is a new record
but I get problems with the above fields. Productcode is
autonummering, code is text.
Thanks,
Marc
 
Back
Top