473,769 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Autonumber strange behavior?

A record of a table with an autonumber field was accidentally deleted. From
the backup table I made a new table with only the deleted record. Then with
an add query I added that record to the original table. After that, when
adding a new record, the autonumber continued with the last ID value (from
the add query) + 1 there by overriding already existing records.

Is this WAD?

What should be best to do in such a situation?

Thanks,
john
Oct 2 '07 #1
5 1774
This is a known bug in JET.

See:
Fixing AutoNumbers when Access assigns negatives or duplicates
at:
http://allenbrowne.com/ser-40.html

The article describes the causes, and how to reset the Seed of the
AutoNumber.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"john" <hg*@neckso.com wrote in message
news:31******** *************** ****@cache110.m ultikabel.net.. .
>A record of a table with an autonumber field was accidentally deleted. From
the backup table I made a new table with only the deleted record. Then with
an add query I added that record to the original table. After that, when
adding a new record, the autonumber continued with the last ID value (from
the add query) + 1 there by overriding already existing records.

Is this WAD?

What should be best to do in such a situation?

Thanks,
john
Oct 2 '07 #2
"john" <hg*@neckso.com wrote in message
news:31******** *************** ****@cache110.m ultikabel.net.. .
>A record of a table with an autonumber field was accidentally deleted. From
the backup table I made a new table with only the deleted record. Then with
an add query I added that record to the original table. After that, when
adding a new record, the autonumber continued with the last ID value (from
the add query) + 1 there by overriding already existing records.

Is this WAD?

What should be best to do in such a situation?

Thanks,
john
Don't include the autonumber field in the append query. That way Access will
assign new autonumbers to all incoming records.

Oct 2 '07 #3
Thanks.
john

"Allen Browne" <Al*********@Se eSig.Invalidsch reef in bericht
news:47******** **************@ per-qv1-newsreader-01.iinet.net.au ...
This is a known bug in JET.

See:
Fixing AutoNumbers when Access assigns negatives or duplicates
at:
http://allenbrowne.com/ser-40.html

The article describes the causes, and how to reset the Seed of the
AutoNumber.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"john" <hg*@neckso.com wrote in message
news:31******** *************** ****@cache110.m ultikabel.net.. .
>>A record of a table with an autonumber field was accidentally deleted.
From the backup table I made a new table with only the deleted record.
Then with an add query I added that record to the original table. After
that, when adding a new record, the autonumber continued with the last ID
value (from the add query) + 1 there by overriding already existing
records.

Is this WAD?

What should be best to do in such a situation?

Thanks,
john

Oct 2 '07 #4
"Stuart McCall" <sm*****@myunre albox.comschree f in bericht
news:fd******** ***********@new s.demon.co.uk.. .
"john" <hg*@neckso.com wrote in message
news:31******** *************** ****@cache110.m ultikabel.net.. .
>>A record of a table with an autonumber field was accidentally deleted.
From the backup table I made a new table with only the deleted record.
Then with an add query I added that record to the original table. After
that, when adding a new record, the autonumber continued with the last ID
value (from the add query) + 1 there by overriding already existing
records.

Is this WAD?

What should be best to do in such a situation?

Thanks,
john

Don't include the autonumber field in the append query. That way Access
will assign new autonumbers to all incoming records.
Since the number of this deleted record was already 'given out' to third
parties as well I wanted it to be added with the original number.

john
Oct 2 '07 #5
"john" <hg*@neckso.com wrote in message
news:9f******** *************** ****@cache100.m ultikabel.net.. .
"Stuart McCall" <sm*****@myunre albox.comschree f in bericht
news:fd******** ***********@new s.demon.co.uk.. .
>"john" <hg*@neckso.com wrote in message
news:31******* *************** *****@cache110. multikabel.net. ..
>>>A record of a table with an autonumber field was accidentally deleted.
From the backup table I made a new table with only the deleted record.
Then with an add query I added that record to the original table. After
that, when adding a new record, the autonumber continued with the last ID
value (from the add query) + 1 there by overriding already existing
records.

Is this WAD?

What should be best to do in such a situation?

Thanks,
john

Don't include the autonumber field in the append query. That way Access
will assign new autonumbers to all incoming records.

Since the number of this deleted record was already 'given out' to third
parties as well I wanted it to be added with the original number.

john
Ah. Misunderstood your question. Sorry. I see Allen's answered it (spot on
as usual!).
Oct 2 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
1866
by: Alan Carter | last post by:
http://www.mvps.org/access/tencommandments.htm Thou shalt not use Autonumber if the field is meant to have meaning for thy users. Why? Alan
16
20526
by: John Baker | last post by:
Hi: I know this is a strange question, but I have inherited a system where files are copied and records re auto numbered (as an index field) )frequently, and I am wondering how high the number can go without the system crashing. An ancillary question is how one resets an auto number so that the sequence starts again at 1. In the case of this file, the auto number field serves no useful purpose except as an
4
2117
by: Vladislav | last post by:
My customers have reported strange behaviour of the locally used modules for running the register on stroke patients, specifically, adding new patient to the register. When analising a sample, I have found that an autonumber variable (id) doesn't behave as expected. At some instant after the record with id=180, the next record is coming with id=158. I can't find any reasonable explanation. Could anybody? V.M.
1
1507
by: Alexander Inochkin | last post by:
Hi! I found same strange behavior of ASP.NET. It is possible this is the bug. Follow the steps:
21
1895
by: MLH | last post by:
I have an A97 database table (tblCorrespondence] in a database installed at 2 sites. The table's key field is not a natural key - its an autonumber field. Here are the values at the 2 sites. First, site #1. Then, site #2. If you plot them, you'll see why I'm worried - I'm afraid I'll be running out-a-numbers soon. For the life of me, I have no clue why they're not incrementing by 1. Hope someone can help. Site #1
0
3574
by: ivb | last post by:
Hi all, I am using DB2 8.1.11.1 on NT with ASP.NET 1.1 When application make connection to database (via ADO.NET), it set "Connection timeout" parameter to 30 seconds. After, when my webpage requests database, and query execution time exceeds 30 seconds, the following error reported: ===
6
2273
by: Joseph Geretz | last post by:
Writing an Outlook AddIn with C#. For the user interface within Outlook I'm adding matching pairs of Toolbar buttons and Menu items. All of the buttons and menu items are wired up to send events to the same method (aka delegate?). I use the Tag property within this method to determine what user action is taking place. Very simple: When adding toolbar button: tbButton.Click += new...
1
5541
by: jason.teen | last post by:
Hi, Curerntly I have designed my table in MS Access with a column of "RuleID" and is set to (autonumber) tblRule: RuleID | Name ------------------------------- 1 | One
11
4498
by: Alan Mailer | last post by:
A project I'm working on is going to use VB6 as a front end. The back end is going to be pre-existing MS Access 2002 database tables which already have records in them *but do not have any AutoNumber* fields in them. Correct me if I'm wrong, but I'm assuming this means that I cannot now alter these existing Access tables and change their primary key to an "AutoNumber" type. If I'm right about this, I need some suggestions as to the...
0
9579
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9422
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9987
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8867
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7404
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6662
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5294
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3952
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2812
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.