AUTONUMBER Field Increments after "UNDO / CLEAR FORM"

S

Stan_B

I have an autonumber field in a form. When I use an "UNDO / CLEAR FORM"
command button (imbedded onto this form) to undo the contents in the form,
the AUTONUMBER value of the next record inputted increments by one.

Example: I am adding / inputting record number 15 (I have the AUTONUMBERed
"RECNUMBER" field visible on my screen form to enable viewing of a specific
record), I discover an error and UNDO / CLEAR the entire form using the
command ("UNDO") button I've created. When I wish to re-input the data, I
see the record number value of the new record is 16, with no record # 15
being created - it has been skipped. I'd prefer to have all the records
sequentially numbered without skips / missing values.

Is there any way to test or set the value of the AUTONUMBER field so that it
adjusts to stay in the proper sequence even should a record get undone?
Thank you ALL for the help.
 
F

fredg

I have an autonumber field in a form. When I use an "UNDO / CLEAR FORM"
command button (imbedded onto this form) to undo the contents in the form,
the AUTONUMBER value of the next record inputted increments by one.

Example: I am adding / inputting record number 15 (I have the AUTONUMBERed
"RECNUMBER" field visible on my screen form to enable viewing of a specific
record), I discover an error and UNDO / CLEAR the entire form using the
command ("UNDO") button I've created. When I wish to re-input the data, I
see the record number value of the new record is 16, with no record # 15
being created - it has been skipped. I'd prefer to have all the records
sequentially numbered without skips / missing values.

Is there any way to test or set the value of the AUTONUMBER field so that it
adjusts to stay in the proper sequence even should a record get undone?
Thank you ALL for the help.

An AutoNumber field need only be unique, not necessarily consecutive.
It need not ever be seen by the user.
If you need a field value to be consecutive you will have to find some
other method.
For example, = DMax([FieldName])+1
as Default value in a Number field will increment the highest value in
that field by 1.
So what?
If you have a list of consecutive numbers and delete one record in the
middle, you once again have a missing number.
Since records, in Access, are stored in no particular order, the
assigned number is meaningless.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top