1LC, this is a common question I get all the time with regards to AutoNumbers. You put one record in and it comes up "1" and then some time later you add another one and it's "5". Why is this?
Well, somewhere along the line you inserted 2, 3, and 4, and then perhaps DELETED them. Access will NOT reassign them again. They're gone. That's why the next record is 5. You see, once an AutoNumber is used, it can NEVER* be reused. This is to maintain integrity in your database. Imagine if you added 5 customers, and each of them have orders in your system. Customer 2 dies so you delete his record (which you shouldn't do, but let's say you did). Now, you add another customer and he gets assigned ID 2. Well, he now just inherited all of the orders for the old dead customer because you forgot to delete all of those too - which, again, you shouldn't do... but this is just an example of WHY AutoNumbers aren't reused.
The good news is that it shouldn't matter. You see, the AutoNumber ID is not for you. It's for THE DATABASE to keep track of unique records. You'll use it later when you get into relating two tables together in my Access 201 class. If you want your OWN number to assign to customers for vanity purposes, then set up your own CustomerNumber system. Don't rely on the ID field. It's being assigned by Access, you just have to deal with the number you're given.
* Now, I should mention for the tech-geeks that read this, that YES you can make Access reassign some of the AutoNumbers with a compact and repair. This is way beyond my Access 101 students, but if let's say you have customers 1 through 5 in the database, and then you delete 3 thru 5 and you want to get 3,4, and 5 back as IDs. If you compact and repair your database, the next ID assigned should be 3. Again, you shouldn't worry too much about what IDs Access is assigning. They're not for YOU. :)
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Beginner 3.