Solved

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

Posted on 2013-05-17
3
434 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
[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:murbro
ID: 39178169
Thanks
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
run FileCopy code from a string 6 52
Access Report formatting issue 5 66
Calculate Weeks in A "Fiscal Month" 8 60
Access Need to add combo box to sub form 10 47
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
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 …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

738 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