Results 1 to 11 of 11
  1. #1
    Join Date
    Jan 2011
    Posts
    83

    Unanswered: Missing Primary Key

    Hi All,

    Has anyone had a problem with missing primary keys?

    My main table every now and then loses the primary key in the table. I have to go into the table and re set the OrderNumber as a primary key.

    Thanks
    Simon

  2. #2
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    994
    Provided Answers: 2
    O.o
    I've never encountered this! Is someone playing a prank on you?
    10% of magic is knowing something that no-one else does. The rest is misdirection.

  3. #3
    Join Date
    Jan 2011
    Posts
    83
    I wish they were lol! I have googled it and seen others have had the problem but no answers.

    Every now and then, records get locked in my main database. I go into the main table, see that the ORDERNUMBER is not selected as the primary key, re set it and all is well.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    sounds suspiciously like symptoms of corruption
    I'd be tempted to take a back up, then do a compact & repair
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Jan 2011
    Posts
    83
    Repaired and has happened again since then

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    how is your application deployed (front end / back end
    do users have their own copy of the front end
    do you have network issues

    horror of horrors do you allow you users to look at and even change the design of the application (use MDE's but always keep copies of your MDB's as development tools)
    I'd rather be riding on the Tiger 800 or the Norton

  7. #7
    Join Date
    Jan 2011
    Posts
    83
    12 users. All have their own front end application on their computer. Their front end links into a seperate tables database on the main server. No network issues really.

  8. #8
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    I agree with the Jade One! Barring someone deliberately sabotaging your app, corruption seems to be the only answer!

    Is OrderNumber, by chance, defined as Autonumber?

    What, exactly, do you mean by 'records get locked in my main database?'

    Did you develop this app from scrap? I seem to remember an Access template that Microsoft had online, a while back, for customer orders, that actually had a corrupted main table!

    After backing the file up, I'd try the old standby of creating a new file and Importing all of your Tables into it, renaming the old file and then renaming the new file as the old file. It's a simple corruption fix that works a good deal of the time.

    Another thing to consider is actually eyeballing the Records in the offending Table after this happens again, looking for strange looking characters. Individual Records can and do become corrupt, leading to all kinds of strange, odd and curious behavior!

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  9. #9
    Join Date
    Jan 2011
    Posts
    83
    OrderNumber is an Autonnumber

    I wrote it from scratch

    Records get locked...e.g, when i open say add a new order form, the code in the open event goes to the last record so you can add a new order. This button just stops working

    Some txtboxes simply wont accept text.

    I will try the old creating a new file and see if that does any good.

    Thanks for your time guys.

  10. #10
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    You might also move that code for moving to the Last Record from the Form_Open event to the Form_Load event, then backing up and doing another C & R. The Form_Open event is really too early to do anything related directly to Records, and can cause problems at times! Notice the at times? I have heard of this misplacement of code causing intermittent problems, which is basically what you're experiencing.

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  11. #11
    Join Date
    Jan 2011
    Posts
    83
    OK Thanks again

Posting Permissions

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