View Full Version : Autonumber Bug


Shadez
04-02-2003, 02:58 AM
Im having a little trouble with the auto number,

I have a table with the auto as the primary key, the problem is that the autonumber for new records is less than the max value of the autonumber field.

eg

max value in key field (2254)
Value auto uses for a new record(2233)

I didnt think this was possible??????:confused:

does anyone know how to fix this error or do i have to get rid of the auto and workout the key number myself

thanks





:cool:ShadeZ:cool:

Rich
04-02-2003, 04:00 AM
There is a problem with newer versions of jet and the autonumber, from what I've read the "fix" doesn't work. Best bet is to search the knowledge base and see if there's a new fix

Pat Hartman
04-02-2003, 01:17 PM
I was a victom of this recently. I tracked the problem down to a form and I was able to actually recreate the problem. I fixed the tables by resetting the autonumber seed using ADO. Adding rows to the table worked fine. Adding rows via a query worked fine. Adding rows with a new form worked fine. Adding a row with the "bad" form, broke the autonumber.

I thought that copying all objects would get rid of the "bad" code in the form but nothing worked. None of the Microsoft suggested fixes worked either. The problem originated in A2K but I could replicate it in AXP. Eventually, I imported all objects EXCEPT the broken form and the broken table. I then recreated both and they have been working fine.

Pat Hartman
04-02-2003, 01:40 PM
I posted the code to reset the autonumber seed for another poster.

http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=45181

I would not recommend this as a solution though since your form will break the table again.

Sam1982
06-26-2003, 12:11 PM
Thanks so so much that is a great help!!

:D :cool: