Next/Last Autonumber in Access

bloukewer

Well-known member
Joined
Jul 2, 2004
Messages
88
Programming Experience
3-5
Does anyone know of a way to get the next "autonumber" ( or the last one that was created) in MSAccess using VB.Net?

It would really save me a few hundred lines of programming. Thanx in advance.
 
Be aware that getting the last ID does not guarantee that you know the next ID. If you add a row and then delete it the next ID will be 2 greater than the last rather than 1. As far as I'm aware there is no way to absolutely get the next auto ID. The whole idea of an auto ID is that you don't care what it is, just that it is unique. If you really do care then you might want to look into using a key manager table.
 
Back
Top