Duplicate Records within Table with Primary Key

R

Roe

This is additional info regarding a post previous to this
one.

I want to duplicate records in a table, which contains a
primary key field, without duplication within the primary
key field. Is there a fancy (or preferably simplistic)
macro sequence that I can create to perform this type of
action?

I already know how to set the value of the primary key
field to a sequential value, but Access wont let me save
even if the primary key field is changed prior to saving
the record.

Your help in this matter is greatly appreciated!

Thanks!
Roe
 
J

Jeff Boyce

Roe

Why? As in "why do you want rows that are identical aside from their
primary key"? If you'll describe what you are trying to accomplish, rather
than how, the 'group's readers might be able to offer some alternatives.

Good luck

Jeff Boyce
<Access MVP>
 
T

TC

Roe, the desire to "duplicate records in a table" suggests a lack of
understanding of the concept of "database normalization".

If you post more information about the nature of the data in your
table, & why you want to duplicate records, someone will be able to
explain in more detail.

Alternatively, take a look at this article:

http://support.microsoft.com/support/kb/articles/Q100139.ASP

HTH,
TC
 
R

Roe

Thanks for the responses!

For example, I have a suppliers table with unique
supplier numbers (primary key field). I want to
duplicate certain records and assign a temporary, yet
sequential supplier number to the duplicate record, so
that there will be no duplicates in the primary key
field.

The reasoning behind this is, I have many suppliers with
the exact same information; only a couple of fields will
require alteration once a desired record is duplicated.
The application I'm working with is being used for data
entry. All these actions should all be performed through
a form where the data is entered from.

Here's another spin on the situation... There are other
tables with data related by the supplier number. I would
also like to have this data duplicated upon duplication
of the data in the supplier table.

Thanks.
 
T

TC

If many suppliers have "the exact same information", then, that information
is not an attribute of the concept "supplier". Therefore, it should not even
*be* in the suppliers table - let alone copied-around from record to record!

You are still on the wrong track, conceptually. Re-read the article that I
referred you to. That article is all about precisely these issues.

HTH,
TC
 
T

TC

I can see you'd rather debate my aptitude than help me.
There are many other users on this message board that
don't have the slightest clue about creating an access
database and they get answers, not arguments.

I've posted over two thousand answers to these newsgroups over the years. So
I do not have to justify my answering style, to you.

So, you're telling me, if I have 2 or more suppliers that
are located in Chicago, IL, I would need to create a
separate table? I disagree!! It will not affect the
performance of the specific tool that I have built, so
why is this a concern of yours?

My friend, it is no longer a concern of mine, at all.

Bye!

TC

(snip further nonsense)
 
R

Roe

I can see you'd rather debate my aptitude than help me.
There are many other users on this message board that
don't have the slightest clue about creating an access
database and they get answers, not arguments.

So, you're telling me, if I have 2 or more suppliers that
are located in Chicago, IL, I would need to create a
separate table? I disagree!! It will not affect the
performance of the specific tool that I have built, so
why is this a concern of yours?

If I was a client of yours and I wanted to have the
capability of duplicating records and then go back a
change certain desired fields, then I should get what I'm
asking for.

I can't explain the entire project to you; it would take
way too long! You don't need all that info.

That's cool. I've figured out a solution on my own.

Temporary tables.
1. The record to be duplicated is appended to a temp
table.
2. The desired changes are then made, including
necessary field alteration of what will be the primary
key in the destination table.
3. The record is then appended back into the main table.

How do you like them apples?!!!
 

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