473,388 Members | 1,256 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Autonumber not unique

I have a table where some of the entries have been deleted so the
primary key field which is set as an autonumber field is not
contiguous. When I try to ad a new record it starts numbering lower
than my highest number.

For example:
1
2
5
7

when I add a new record it tries to make the autonumber 5 then errors
out. I am sure this is an easy solution but I am racking my brain!
Thanks in advance.
Jul 24 '08 #1
2 1772
See:
Fixing AutoNumbers when Access assigns negatives or duplicates
at:
http://allenbrowne.com/ser-40.html

The article explains what triggers this bug, and the code resets the
AutoNumber for any tables that currently have the Seed too low.

--
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.

"Tyler" <ty***********@gmail.comwrote in message
news:5e**********************************@t54g2000 hsg.googlegroups.com...
>I have a table where some of the entries have been deleted so the
primary key field which is set as an autonumber field is not
contiguous. When I try to ad a new record it starts numbering lower
than my highest number.

For example:
1
2
5
7

when I add a new record it tries to make the autonumber 5 then errors
out. I am sure this is an easy solution but I am racking my brain!
Thanks in advance.
Jul 24 '08 #2
On Jul 24, 8:17*am, "Allen Browne" <AllenBro...@SeeSig.Invalidwrote:
See:
* * Fixing AutoNumbers when Access assigns negatives or duplicates
at:
* *http://allenbrowne.com/ser-40.html

The article explains what triggers this bug, and the code resets the
AutoNumber for any tables that currently have the Seed too low.

--
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.

"Tyler" <tyler.horn...@gmail.comwrote in message

news:5e**********************************@t54g2000 hsg.googlegroups.com...
I have a table where some of the entries have been deleted so the
primary key field which is set as an autonumber field is not
contiguous. *When I try to ad a new record it starts numbering lower
than my highest number.
For example:
1
2
5
7
when I add a new record it tries to make the autonumber 5 then errors
out. *I am sure this is an easy solution but I am racking my brain!
Thanks in advance.- Hide quoted text -

- Show quoted text -
AWESOME thanks.
Jul 24 '08 #3

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

Similar topics

13
by: Tony Williams | last post by:
I have a table called tblseries with a field NextNumber I also have a form called form1 based on table1 On the form is a control NNum which I've called NNumtxt with the following code in the...
2
by: Charles Robinson III | last post by:
The AutoNumber sequence in my database is currently formatted as '000000'. When a new record is created, the AutoNumber would go from 000001, 000002, 000003 and so on. I want to track via...
33
by: Lee C. | last post by:
I'm finding this to be extremely difficult to set up. I understand that Access won't manage the primary key and the cascade updates for a table. Fine. I tried changing the PK type to number and...
35
by: Traci | last post by:
If I have a table with an autonumber primary key and 100 records and I delete the last 50 records, the next record added would have a primary key of 101. Is there any way to have the primary key...
4
by: yf | last post by:
A KB article "http://support.microsoft.com/default.aspx?scid=kb;en-us;209599" tells that the maximum number of records that a table may hold if the PRIMARY key data type is set to AUTONUMBER is...
8
by: mathilda | last post by:
I have a situation where I need to put back in a deleted record to a table whose primary key is an Autonumber. And of course the autonumber has to match what it was before. Any way of saving my...
33
by: Steven Taylor | last post by:
Hope someone can help. This is half an Access question. The half I'm using is Access Xp as a backend data file. I'm using ODBC to connect to the data file. All commands are via SQL type...
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...
9
by: Tom_F | last post by:
To comp.databases.ms-access -- I just discovered, to my more than mild dismay, that some tables in my Microsoft Access 2003 database have duplicate numbers in the "AutoNumber" field. (Field...
9
by: Gogo | last post by:
Database has record 59 showing, tabing to enter data returns autonumber to 134. What happened to cause this, how would I fix it?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.