Hey,
Is there a way to see what the next autonumbe is in my tabl? thanks,
Hey,
Is there a way to see what the next autonumbe is in my tabl? thanks,
Perhaps you could use the DMax() function to return the highest current value and then add one to it. I don't think the result would be very reliable in a multi-user db.
Not sure why you might want to do this though.
If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
Bob Fitzpatrick
i am currently doing that right now, you are right it is very unreliable as the next number incremented may not be the next number given by the autonumber. im going to keep using this, but if there is a way to veiw the precise number please let me know, thank you
Can you tell us why you need to know what the next number will be.
If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
Bob Fitzpatrick
mike02, you are aware that autonumbers (the autonumber field type) are not guaranteed to be sequential, consecutive or even positive??
Mike -
From your posts, I gather you want the autonumber value to have some meaning, as in next document number, or some such. The general consensus is that an autonumber should be used only to ensure a unique ID for each record, and should not be relied upon to be sequential or predictable. If you need to have such a value, you should maintain it yourself (DMax is just the type of function you would use) to ensure predictability. My own opinion is that if you have a field like that and make it the PK of your table, you can do away with the autonumber entirely.
My 2-cents worth
John
i am aware of the meaning of auto number and that Dmax doensnt work properly as autonumber is not necesarally secuential. this is why i am posting to see if there is a way to see the next number. i just need it to keep unique ids for my tables. I am just curious to see if i can se the next number that is all.
You do not need to see the "next" autonumber. It will be unique, that is what an autonumber is UNique -not incremental nor positive as others have said.
see http://www.utteraccess.com/wiki/index.php/Autonumbers
I understand that auto number is unique i was just curious to see if there was a function to see what was the next to come, with the uniqueness there is still going to be an algorythem for it to pick the unique number. so i was curious to see if aynone knew what it was.