472,809 Members | 3,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,809 software developers and data experts.

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 1732
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.comwrote in message
news:31***************************@cache110.multik abel.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.comwrote in message
news:31***************************@cache110.multik abel.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*********@SeeSig.Invalidschreef 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.comwrote in message
news:31***************************@cache110.multik abel.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*****@myunrealbox.comschreef in bericht
news:fd*******************@news.demon.co.uk...
"john" <hg*@neckso.comwrote in message
news:31***************************@cache110.multik abel.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.comwrote in message
news:9f***************************@cache100.multik abel.net...
"Stuart McCall" <sm*****@myunrealbox.comschreef in bericht
news:fd*******************@news.demon.co.uk...
>"john" <hg*@neckso.comwrote in message
news:31***************************@cache110.multi kabel.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
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
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...
4
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...
1
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
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....
0
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...
6
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...
1
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 ...
11
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.