Results 1 to 7 of 7
  1. #1
    Tammy is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2014
    Posts
    29

    SOS.... AutoNumbering Issue

    Hi All

    I've come across an issue that I can't figure out. I have a database that is accessible to my entire group but today I went to add a new record and it is duplicating the PK Autonumber field and then saying there is duplicates in the Primary Key field. It won't allow me to add any new records. I'm at AutoNumber 59 but when I add a new record now it assigns 13 which was used some time ago. Then the message saying I've got a duplicate in the primary key and you can't save this record at this time message comes up.

    Any Idea?

    Seriously stressed.



    Tammy

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Never encountered this before.

    Try Compact & Repair to see if that fixes issue.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Tammy is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2014
    Posts
    29
    this database is a split database. The back end is most likely where the issues resides but I'm afraid of what will happen if I run the Compact and Repair on it. I'm afraid all the linking will get messed up. I could copy the backend and test the compact and repair on it I suppose as a test.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Start with that.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Tammy is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2014
    Posts
    29
    That may have fixed it. I just did a test and it looks like the numbering is now working. I'll keep my fingers crossed for the live database.

  6. #6
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    To what extent are you using VBA code to add or delete records? Adding records and explicitly specifying an autonumber value may LOOK like it works, but it can cause serious problems, one of them being the error you were getting.

  7. #7
    Tammy is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2014
    Posts
    29
    I'm not using VBA code. I think the problem stemmed from a sub form with a query that related to the PK from the main table. I put a delete button on this sub form which allowed people to delete the record but I believe it traced it back to the main table through the PK and deleted the record from the main table. Hope that makes sense. I've since adjusted the query so it doesn't link to the PK of the main table but the FK from the secondary table.

    Thanks All.

    Tammy

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

Similar Threads

  1. Custom Autonumbering
    By mguardab in forum Access
    Replies: 1
    Last Post: 05-22-2014, 12:02 PM
  2. Replies: 2
    Last Post: 06-28-2013, 01:27 PM
  3. autonumbering.
    By puzzlednewbie in forum Access
    Replies: 3
    Last Post: 09-24-2012, 11:33 AM
  4. Replies: 1
    Last Post: 11-21-2010, 01:19 AM
  5. Autonumbering when a checkbox is clicked?
    By kutehart in forum Forms
    Replies: 1
    Last Post: 08-02-2010, 09:03 AM

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