Results 1 to 3 of 3
  1. #1
    msmithtlh is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    151

    Help!! Problem with primary key and not creating new records


    Something has gone wrong with my primary key.

    I have a main table, with an autonumber primary key. I also have a related table, which inherits the main table primary key when a record is created. They are separate because many records only have data in the main table, but others have many more fields of data. This has been working fine until this morning.

    I have a separate forms to add records, and a different form to update records. Last Friday I merged in some of the data which only has data in the main table. I think this must be related to the problem we see this morning.

    The highest record number - looking straight at the table is 1280, but when I go to the add form, it brings up record 731 (with the data) and although I, of course don't want to save it, when I close the form, it pops up the message that I can't save the record because it would create duplicate values.

    I have worked with Access for many years and have never seen anything like this. Thanks in advance!!!

  2. #2
    msmithtlh is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    151
    I need to clarify one thing. There are gaps in the record numbers. I took a copy and started adding records, it was using the "unused" numbers, but then when it got to a number that had been used, it still tried to use it again. Is there a way to give the autonumber a beginning number?

  3. #3
    msmithtlh is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    151

    Problem with primary key

    Quote Originally Posted by msmithtlh View Post
    I need to clarify one thing. There are gaps in the record numbers. I took a copy and started adding records, it was using the "unused" numbers, but then when it got to a number that had been used, it still tried to use it again. Is there a way to give the autonumber a beginning number?
    I finally fixed it by renaming the table and running a make table query to replace the old data. Scary!!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. primary key autonumbers problem
    By jinz in forum Access
    Replies: 6
    Last Post: 11-21-2012, 06:08 PM
  2. Replies: 3
    Last Post: 09-25-2012, 05:24 PM
  3. Error creating new primary key
    By quicksun in forum Forms
    Replies: 2
    Last Post: 08-01-2012, 08:53 AM
  4. Problem with primary key on imported database
    By 1953hogan in forum Access
    Replies: 1
    Last Post: 06-23-2011, 05:02 PM
  5. Replies: 0
    Last Post: 10-23-2008, 12:08 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums