Copy or Duplicate Record Woes

B

bobdydd

Hi Everybody

Access 2007

I have a form based on a query that does NOT
include the primary key autonumber
And I am trying to use the "Duplicate" command

Yet I get the error that this new record has created
"duplicate Values in the Index, Primary Key, or Relationship"

Is there any other way to copy a record?

Thanks
 
J

Jeff Boyce

First, why?

In a well-normalized relational database, you probably won't need to "copy a
record", even if you're intending to give it a new unique record ID.

Perhaps there's a different way to accomplish what you're after .. which is
....? You are trying to solve a business need by "copying a record" ...
what's that business need?

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or psuedocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
M

Marco Pagliero

I have a form based on a query that does NOT
include the primary key autonumber
And I am trying to use the "Duplicate" command
Yet I get the error that this new record has created
"duplicate Values in the Index, Primary Key, or Relationship"

Is there any other way to copy a record?

Not only the primary key autonumber, but every field in a table could
be "indexed without duplicates". Maybe you'd like to assure yourself
that there is no such a field in your table before looking for other
ways of duplicating records.

greetings
Marco P
 
M

Marshall Barton

bobdydd said:
Access 2007

I have a form based on a query that does NOT
include the primary key autonumber
And I am trying to use the "Duplicate" command

Yet I get the error that this new record has created
"duplicate Values in the Index, Primary Key, or Relationship"

Is there any other way to copy a record?


Well, there are several ways to copy a record, but you can
never add a record with a duplicate primary key no matter
what you do. Maybe it would help if you provided more
details about the table's primary key field.

What is a Duplicate command? A command button with it's
Click event procedure generated by the Duplicate Record
wizard??
 

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