Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2004
    Posts
    14

    Unanswered: Changing Primary Key to AutoNumber

    I have another question. When I built this db, the primary key (org_id) was originally intended as a user input field when a new org was added. The db is now unexpectedly being used by multiple users who all enter new orgs (and therefore could have conflicts or overwrite records when they sync up with the master). I have already established relationships and completed forms, macros, queries, and reports. Hindsight being 20/20, I'd like to now change the org_id to be an autonumber field, but I know I cannot just change the data type and have it all flow through.

    Is there a way to change this primary key to autonumber without having to do a bunch of rework on the things that are already done? Any ideas would be most welcome. Thanks for your help!

  2. #2
    Join Date
    Mar 2004
    Location
    belgium
    Posts
    290

    prime to auto

    designe a new table(with the same fields of the original table) and add a autonumber field, execute an appendquery from the original table to the new table, or if the org-id must be equal to the autonumber, execute a piece of programme that first adds the amount of blank records to the new table that fits with the highest number of the Id-org, and then replace the blank records with the data of the original table for Autonumber = Id-Org.

    hope this will at any help

    emiel

  3. #3
    Join Date
    Oct 2004
    Posts
    14

    Thanks!

    Perfect! Worked like a charm. Thanks for your help!

Posting Permissions

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