Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

autonumber fields

Discussion in 'Information Technology' started by Todd Hudson, Jul 28, 2006.

  1. Todd Hudson

    Todd Hudson
    Expand Collapse
    Guest

    I deleted several rows of data and want the next auto number to be 297.
    Instead it is 344.

    How can I get it to start at 297?

    Thanks
     
  2. Loading...

    Similar Threads Forum Date
    US Defense Department Hiring Resident Aliens in Medical and Language Fields Business, Lifestyle & Leisure Dec 6, 2008
    Sikh News Women more vulnerable to cancer in Punjab's cotton fields (New Kerala) Breaking News Apr 1, 2008
    Sikh News Women more vulnerable to cancer in Punjab's cotton fields (Calcutta News) Breaking News Apr 1, 2008
    Sikh News Punjab's killing fields (The Times of India) Breaking News Feb 24, 2008
    Sikh News MQM fields 218 candidates in Punjab (The Pakistan Link) Breaking News Feb 1, 2008

  3. KARL DEWEY

    KARL DEWEY
    Expand Collapse
    Guest

    Try compacting and repair.

    "Todd Hudson" <tatung70nospam@hotmail.com> wrote in message
    news:uArDgQEkGHA.4368@TK2MSFTNGP03.phx.gbl...
    > I deleted several rows of data and want the next auto number to be 297.
    > Instead it is 344.
    >
    > How can I get it to start at 297?
    >
    > Thanks
    >
    >
     
  4. salex

    salex
    Expand Collapse
    Guest

    Copy structure and data from old table into new table.
    After that, field(s) with Autonumber will be set to (MaxFound+1).


    "Todd Hudson" wrote:

    > I deleted several rows of data and want the next auto number to be 297.
    > Instead it is 344.
    >
    > How can I get it to start at 297?
    >
    > Thanks
    >
    >
    >
     
  5. '69 Camaro

    '69 Camaro
    Expand Collapse
    Guest

    Hi, Todd.

    > How can I get it to start at 297?


    If you need the numbers in this column to be sequential, then you shouldn't
    be using an AutoNumber, because they aren't guaranteed to be sequential,
    even when they're set to increment by 1. You should use a custom function
    to return a sequential number.

    That said, assuming that you have 296 records in this table and no numbers
    in this column above 297, first make a backup of the database file, turn off
    "Track name AutoCorrect," then delete any relationships with this table's
    related tables. Rename your table, then make a copy of the structure (no
    data) and name this copy the same as the original table. Append the data
    from the original table into the new, empty table. Try:

    INSERT INTO tblEmptyTable
    SELECT *
    FROM tblOldTable
    ORDER BY ID;

    .. . . where tblEmptyTable is the copy of the table that you made which has
    been renamed as the original table's name, tblOldTable is the original table
    full of records, and ID is the AutoNumber column. When done, reestablish
    the relationships with any related tables on the new table. When you've
    verified that everything is correct, delete the old table and compact.

    When you add a new record, the AutoNumber will be 297.

    HTH.
    Gunny

    See http://www.QBuilt.com for all your database needs.
    See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
    http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
    info.


    "Todd Hudson" <tatung70nospam@hotmail.com> wrote in message
    news:uArDgQEkGHA.4368@TK2MSFTNGP03.phx.gbl...
    >I deleted several rows of data and want the next auto number to be 297.
    >Instead it is 344.
    >
    > How can I get it to start at 297?
    >
    > Thanks
    >
     
  6. Joseph Meehan

    Joseph Meehan
    Expand Collapse
    Guest

    Todd Hudson wrote:
    > I deleted several rows of data and want the next auto number to be
    > 297. Instead it is 344.
    >
    > How can I get it to start at 297?
    >
    > Thanks


    I suggest you may not want to use Autonumber for that use. Autonumbers are
    designed to provide unique numbers. It in not designed to provide numbers
    in order and for a number of reasons may not do so. As a result using them
    in any application where the user sees the numbers is likely to end up with
    confusion.

    There are other ways of providing the numbers you want depending on the
    particual application.


    --
    Joseph Meehan

    Dia duit
     

Share This Page