Autonumber

  • Thread starter Thread starter Milindra
  • Start date Start date
M

Milindra

I set my EmployeeID field as a Autonumber. Let say the
now the number runs from 1 to 10, but now I want to
delete three of them. Since it was setup as Autonumber so
when I add a new Employee, it will automatically generate
Employee number 11 instead of 8.

Is there anyway that I can program Autonumber to see
Maximum record and plus 1 so that it will has a right ID
number.

Thanks in advance,
Milindra
 
I set my EmployeeID field as a Autonumber. Let say the
now the number runs from 1 to 10, but now I want to
delete three of them. Since it was setup as Autonumber so
when I add a new Employee, it will automatically generate
Employee number 11 instead of 8.

Is there anyway that I can program Autonumber to see
Maximum record and plus 1 so that it will has a right ID
number.

Thanks in advance,
Milindra

You are miss-using the Autonumber field if you use it for any purpose
other than being a unique number.

If you feel you must number records in a consecutive order, you'll
need to make your own ordering system.
Set the Default value of the field to
=DMax("[FieldName]","TableName")+1

But then if you later delete record #50 out of 75, you will still be
missing that one number.
 
Hi Milindra,
by definition you are unable to edit an autonumber
datatype. You can fill-in 'missing' numbers using an
append query. But you must be careful to avoid problems if
there are related records from previously deleted records
with the same id.

Luck
Jonathan
 
Many thanks to all of you. This help me a lot.

Milindra
-----Original Message-----
I set my EmployeeID field as a Autonumber. Let say the
now the number runs from 1 to 10, but now I want to
delete three of them. Since it was setup as Autonumber so
when I add a new Employee, it will automatically generate
Employee number 11 instead of 8.

Is there anyway that I can program Autonumber to see
Maximum record and plus 1 so that it will has a right ID
number.

Thanks in advance,
Milindra

You are miss-using the Autonumber field if you use it for any purpose
other than being a unique number.

If you feel you must number records in a consecutive order, you'll
need to make your own ordering system.
Set the Default value of the field to
=DMax("[FieldName]","TableName")+1

But then if you later delete record #50 out of 75, you will still be
missing that one number.

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 
Back
Top