Duplicate Record with Primary Key

C

Chris

I want to be able to copy a record within the same table. I added a command
button to duplicate record on a form. The problem is there is a primary key
and it will not allow me to copy. The records gets written to a paste error
file. Is there any method to copy all but the primary key and get access to
assign a new (autonumber) for the new record?

Thanks.
 
A

Arvin Meyer [MVP]

In the table, or in a query, you should be able to just copy and paste. The
autonumber will change to the new one.

From a form, use a recordset, or an Insert statement to append a record to
the table, leaving out the autonumber field.
 

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