Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Posts
    5

    Question Unanswered: Autonumber on a current table

    I have a table of customers and I would like to change the customer numbering over to autonumber and start it at 2000. I need to protect the previuos customer numbers as they are related to invoice header and detail record info... I have tried a couple of things but it seems to redefine the numbering scheme for the old records. Any help would be great. Thanks ahead of time.

  2. #2
    Join Date
    Dec 2003
    Posts
    16

    Re: Autonumber on a current table

    Originally posted by FOTH
    I have a table of customers and I would like to change the customer numbering over to autonumber and start it at 2000. I need to protect the previuos customer numbers as they are related to invoice header and detail record info... I have tried a couple of things but it seems to redefine the numbering scheme for the old records. Any help would be great. Thanks ahead of time.
    Here is something I clipped from The Access Web:
    ---Posted by Dev Ashish---

    --------------------------------------------------------------------------------
    Tables: Have Autonumber field start from a value different from 1
    --------------------------------------------------------------------------------


    (Q) Can I change the starting value of a counter type field?

    (A) Yes, you can.. to do this:
    Create the first table that contains the counter type field that you want to start on another number. Don't enter any records.Create a second table, with a single long integer number type field that has the same name as the counter field in the first table. Create a record in the second table by entering a number one less than the number you want to start the counter at in the first table. Create an append query, to append the one record in the second table to the first table, and run it Delete the second table, delete the record that you appended to the first table, and start entering data.

    Alternative method: (Posted by Alden Streeter)

    You can make an Append query that just appends a value from a parameter, to just the auto-number field (as long as no other fields are required), e.g.:

    PARAMETERS [Number] Long;
    INSERT INTO tblAuto ( intNumber )
    SELECT [Number] AS Expr1;

Posting Permissions

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