"AutoNumber" again

W

WC Lo

I know there are a lot threads talked about AutoNumber. I tried to search but cannot find a similiar situation.
I have a table with autonumber as primary key and a form for data input. When something has been typed in the form, Access has got hold of the "autonumber". But, if the user changes the mind the create the record, I found that number is consider used. Any idea that I can release this "unused" number so that the number will not be wasted. Thanks.
 
A

Alex Dybenko

in order to release - you have to compact database. but this works only for
last unused number(s) (at the end)

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com

WC Lo said:
I know there are a lot threads talked about AutoNumber. I tried to search
but cannot find a similiar situation.
I have a table with autonumber as primary key and a form for data input.
When something has been typed in the form, Access has got hold of the
"autonumber". But, if the user changes the mind the create the record, I
found that number is consider used. Any idea that I can release this
"unused" number so that the number will not be wasted. Thanks.
 
M

Michael J. Strickland

If you don't mind auto-numbering being reset to begn at 1,
you can just go into design mode, delete the autonumber field,
and then re-create it.

The new autonumber field will be ordered consecutively from 1 to
the number of records in the table.

--
---------------------------------------------------------------
Michael J. Strickland
Quality Services [email protected]
703-560-7380
---------------------------------------------------------------
WC Lo said:
I know there are a lot threads talked about AutoNumber. I tried to search
but cannot find a similiar situation.
I have a table with autonumber as primary key and a form for data input.
When something has been typed in the form, Access has got hold of the
"autonumber". But, if the user changes the mind the create the record, I
found that number is consider used. Any idea that I can release this
"unused" number so that the number will not be wasted. Thanks.
 
W

wc Lo

Thanks to all. Actually I understand what you guys saying. May be I am not 100% clear how the AutoNumber works. I noticed that my records started from 1 and increment by 1 every time. Until one day when my user was doing data entry, he had input most of the idata but all a sudden he changed the mind to cancel the input. So he closed the form. I noticed that the record had not been inserted to the table but the autonumber had been used
The sequent of the number was 1 .. 2 ... 3 ... 4 ... skip ... 5 ... 6 .... I wonder, in such case, can I tell the autonumber to stop plus one?
 
R

Rick Brandt

wc Lo said:
Thanks to all. Actually I understand what you guys saying. May be I am
not 100% clear how the AutoNumber works. I noticed that my records started
from 1 and increment by 1 every time. Until one day when my user was doing
data entry, he had input most of the idata but all a sudden he changed the
mind to cancel the input. So he closed the form. I noticed that the
record had not been inserted to the table but the autonumber had been used.
The sequent of the number was 1 .. 2 ... 3 ... 4 ... skip ... 5 ... 6
..... I wonder, in such case, can I tell the autonumber to stop plus one?

No. If you care about the value in ANY way other than uniqueness, then
don't use an AutoNumber.
 
Top