473,326 Members | 2,168 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,326 software developers and data experts.

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

sueb
379 256MB
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

✓ answered by sueb

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.

4 3040
Mariostg
332 100+
Did you try to compact and repair your database?
Nov 26 '10 #2
sueb
379 256MB
Yes--I actually do that every evening.
Nov 26 '10 #3
Mariostg
332 100+
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 256MB
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
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...
13
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
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...
3
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...
5
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...
17
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...
7
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...
0
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...
3
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...
8
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.