Solved

MS Access Duplicating records does not create a unique AutoNumber for ID column

Posted on 2013-05-17
3
428 Views
Last Modified: 2013-05-18
Hi. I am using the following SQL in an Access Query to duplicate rows for a certain TransactionID. It works fine but for some reason the new records have the same number
as the original records for the ID column, which is an AutoNumber column. I'm not sure how this is possible as I would expect unique numbers to be generated.


INSERT INTO Transactions
SELECT *
FROM Transactions
WHERE TransactionID=17330;
0
Comment
Question by:murbro
3 Comments
 
LVL 39

Accepted Solution

by:
als315 earned 250 total points
ID: 39176994
I think you allow duplicates in ID field. Can you upload sample DB with this table and  some dummy records. Try not to use *, add fields separately.
0
 
LVL 9

Assisted Solution

by:Armen Stein - Microsoft Access MVP since 2006
Armen Stein - Microsoft Access MVP since 2006 earned 250 total points
ID: 39177198
An append query like yours can set the value of an autonumber.  This is a handy capability if you are converting records from another system.  In your case, specify all the other fields but not the autonumber; you can't use *.

Cheers,
Armen Stein
0
 

Author Closing Comment

by:murbro
ID: 39178169
Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now