copy a record in a form to a new record

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top