473,541 Members | 14,844 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why is Access trying to re-use an AutoNumber when I add a record?

sueb
379 Contributor
In my database, I have specified that the primary key ("PatientIndex) is an AutoNumber, and that duplicates are not allowed. ("New Values" is set to "Increment", "Indexed" is set to "Yes (No Duplicates)", and it is the primary key.)

However, when I try to add a new record, Access provides a value for the new record that already exists in the existing records. Why is that, and how do I make it create a new, unused one?
Nov 26 '10 #1
4 3052
Mariostg
332 Contributor
Did you try to compact and repair your database?
Nov 26 '10 #2
sueb
379 Contributor
Yes--I actually do that every evening.
Nov 26 '10 #3
Mariostg
332 Contributor
There are discussions on this topic in this forum like this one:
Autonumber duplicates
Maybe that could help. There are others too.
Nov 26 '10 #4
sueb
379 Contributor
I stumbled across a fix! (Caution: It's lame.)

In trying to get the starting AutoNumber set to what would work, I made a copy of the table. I noticed that trying to add a record to this new table resulted in a correct AutoNumber, so I took a chance: I renamed the original table to get it out of the way, and renamed the new table to the correct name.

Bingo! AutoNumber now works, and my linked tables are none the wiser.

Thanks, Mario, for the link, though--good info there.
Nov 26 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
23599
by: Robert | last post by:
I am having performance issues on a SQL query in Access. My query is accessing and joining several tables (one very large one). The tables are linked ODBC. The client submits the query to the server, separated by several states. It appears the query is retrieving gigs of data from the table and processing the joins on the client. Is there...
13
6563
by: S. Blond | last post by:
I heard a rumor that Microsoft will no longer support Access (perhaps starting next year). Can anyone verify this? I find it hard to believe. Thanks!
10
2342
by: Sue Bricker | last post by:
Is it possible to create an MS/ACCESS database application and package it for users who do not have MS/ACCESS loaded in their PCs? I was told that this is possible, but I don't know what software is needed. Do you know? If so, please answer this post. Thanks. SueB *** Sent via Developersdex http://www.developersdex.com *** Don't...
3
2110
by: I_have_nothing | last post by:
Hi! I am new in C. I got a lots of "Segmentation Fault"s in my code. I guess One possibility is: if " int array_i; " is declard and the code trys to access "array_i", a Segmentation Fault will be returned by gcc compiler on linux. What are the other "major" reasons to have "Segmentation Fault"? I hope this is not a stupid question and...
5
1317
by: MP | last post by:
context: vb6 / ado / adox 2.8/ mdb file format / jet 4.0 provider (not using Access) trying to design first database I work for a very small company, detailing building 'components' There is currently no database usage in our company. On my own time I'm trying to learn database/ado so as to improve the way we work.
17
2871
by: Lauren Quantrell | last post by:
Using MS Access 2K, I have a client with a number of seperate customer tables for each country, approx 50 tables, stored on a SQL Server backend. I cleaned up the data in the tables and inserted all the records into one table and ended up with a table with 1,200,000 rows that looks like this: CustomerID int (PK) CustomerName...
7
1556
by: SHPsalm139 | last post by:
Has anyone run into the following problem: From Access, trying to link or import a file that is part of a folder structure on a network drive where at least one of the folders has a blank space in the name, results in an error that the file is not recognized. The same folder name on my "C" drive works fine. Sheldon Potolsky
0
1131
by: Vincent | last post by:
The personal firewall on my computer keeps informing me that MS Access is trying to access the Internet. I deny the process from continuing, so I don't know where it is trying to go. Is this typical behavior for MS Access? Thanks.
3
3867
by: Comteck | last post by:
I am quite proficient at programming Visual Basic for Microsoft Access. I am currently learning Visual Basic 6, and would like to be able to take my database files from Access, and re-write them in VB 6. One database program that I wrote had a subform in one of the forms. I was able to link the subform to the form simply by going into the...
8
4455
by: someone | last post by:
I'm making an program that encodes text, and then writes it into another text file. The problem is that I can't seem to get the "file exists" checking right. If I use the command (coder is the application): coder something.txt an_exsiting_file.txt, then if I chose to overwrite "an_exsiting_file.txt", an error message pops up, saying that to...
0
7316
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...
0
7711
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7306
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...
0
7657
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5845
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...
1
5231
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...
0
3366
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1782
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
1
937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.