Access primary key reset problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ilany
    New Member
    • Mar 2008
    • 4

    Access primary key reset problem

    Hi to all..

    The relationships in my database depend on autonumbered primary keys. Occasionally access will crash, causing all primary key values to be reset in tables. Now that the primary keys are rest, the table relationships are no longer valid.

    Example:

    For two tables, Suppliers, and Addresses

    In Addresses the promary key is AddressID.

    In suppliers I have a field AddressID. If access crashes the primary key index goes back to 1 in Addresses, and the Suppliers tables will refer to an AddressID with a no longer (or incorrect now) AddressID since all addressID's were reset.

    Any suggestions? (other than making a backup of course)

    I'm sure someone came across this before.

    Thanks

    Ilan
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    Strange, I've never experienced Access to change the data in tables when the database crashes.
    What version of Access are you using ?
    Is there no coding running when starting the database ?

    Nic;o)

    Comment

    • ilany
      New Member
      • Mar 2008
      • 4

      #3
      There is coding running when on startup, but I couldn't see how that would affect anything. The case is through, that primary key values have a potential to be reset, without my consent (or intentional consent). I'm using Access 2002.

      Would acecss 2007 run my code with no problem? Or no editing?

      Thank you

      Comment

      Working...