Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2002
    Posts
    33

    Unanswered: problem with AutoNumber

    hi,

    i have a field "Receipt Number" and field type is AutoNumber. it started from number 1. but i deleted the first record. now its second record became first record. but still the receipt number is 2. how can i change the number as 1. anybody has any idea?

    Anwar

  2. #2
    Join Date
    Oct 2002
    Location
    Greensboro, NC
    Posts
    50

    Re: problem with AutoNumber

    Originally posted by mdaislam
    hi,

    i have a field "Receipt Number" and field type is AutoNumber. it started from number 1. but i deleted the first record. now its second record became first record. but still the receipt number is 2. how can i change the number as 1. anybody has any idea?

    Anwar
    Hi
    Once you use the number have been assigned to the record you cannot use that number again.

  3. #3
    Join Date
    Dec 2002
    Location
    Southern CA
    Posts
    8

    Re: problem with AutoNumber

    If there are no records in the table, you can use the "Compact and Repair Database" utility, and it will start your numbers over. However, if you have records in the table, and have links based on that Autonumber field, I would recommend that you just stick with the number assigned. The reason that AutNumbers do not shift/adjust when a record is deleted is because this field is usually used as a primary key and linked to other records/tables.

    Tiffany


    Originally posted by mdaislam
    hi,

    i have a field "Receipt Number" and field type is AutoNumber. it started from number 1. but i deleted the first record. now its second record became first record. but still the receipt number is 2. how can i change the number as 1. anybody has any idea?

    Anwar

  4. #4
    Join Date
    Oct 2002
    Posts
    33
    that means i can't delete any record if i use the field type AutoNumber? i mean if i delete any record it will miss the sequence.

  5. #5
    Join Date
    Dec 2002
    Location
    Southern CA
    Posts
    8
    Yes, if you delete a record once it has been created, that number is permanently deleted also.

    If you need consecutive numbers, then use the AutoNumber field just as an invisible link (don't put it on your forms, etc.-- use it only for relationship purposes), and create a second number field where you can enter consecutive numbers.

    Tiffany

    Originally posted by mdaislam
    that means i can't delete any record if i use the field type AutoNumber? i mean if i delete any record it will miss the sequence.

  6. #6
    Join Date
    Oct 2002
    Posts
    33
    thanks Tiffany,

    it helped me a lot

    Anwar

  7. #7
    Join Date
    Apr 2002
    Posts
    139
    For reasons of completeness and awareness:

    If the last record in an autonumber sequence is deleted, and the database is compacted directly afterwards, than you will find the same autonumber issued again with the first new record.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •