Solved

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

Posted on 2013-05-17
3
437 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:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 40

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:Murray Brown
ID: 39178169
Thanks
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

691 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