Results 1 to 10 of 10
  1. #1
    Tizzy22 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2014
    Posts
    5

    Splitting Database - Index or primary key cannot contain a Null value


    Hi All, I hope you can help.

    I've inherited a rather messy database which and I need to split it in order for us all to be able to enter data at the same time without problems however I get the following message:

    Index or primary key cannot contain a Null value

    It happens at the table that contains the majority of the data (typical) but I cannot understand what could be causing it. I've check Null Primary Key field and removed all of the "required" statuses out of the fields but still no luck.

    I tested on a backup database from a couple of days ago and it worked. Only difference is I've added a few bits and bobs since then and 1 field in the table it's stalling on but this field doesn't contain any null values either and I've tried deleting that field in my test database but made no difference.

    I'm tearing my hair out now - is there any easy way to check what it's actually referring to??

    Thanks in advance,

    Tizzy

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    It throws the error when you use the build-in splitter, right?

  3. #3
    Tizzy22 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2014
    Posts
    5
    Yeah its the built in one . I deleted all the data from my table in test and it split fine so I'm 100% sure now it's that table but can't understand why.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Will your db do a Compact and Repair?

  5. #5
    Tizzy22 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2014
    Posts
    5
    Hi RG,

    Compact and repair works fine.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Well I'm not sure what is causing the issue but it is pretty easy to manually split a db. Do you want to just do that?

  7. #7
    Tizzy22 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2014
    Posts
    5
    Hi RG, sorry for the delay in responding and thanks so much for your help so far.

    Yes if it's easy enough to do then that would be great. Can you tell me how though??

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I would create two new db's named ~FE.accdb and ~BE.accdb using your name for the "~". Then open the BE and *import* the tables from your original file. Save and close and open the FE. Import everything BUT the tables from the original file. Use the Linked Table Manager to add in the linked tables from the BE. Save and close and your done. Test it to see if it works.

  9. #9
    Tizzy22 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2014
    Posts
    5
    Hi RG, I posted an update yesterday but it doesnt seem to have appeared! I found instructions on how to do it manually and tried - it imported every table apart from the one I'm having problems with.

    So this morning I've tried again. This time I imported everything I could then exported the PEOPLE (the one I have problems with) table to Excel and imported it to the back end letting access recreate the primary key.

    I'm now getting loads of VB errors. I probably should've mentioned the database also allows me to track who has logged on and when and who inputted each record. I think maybe I need these tables in the front end in order for it to work properly. I think I'll have to give this up for the time being but at least I've managed to split it

    Thanks for your help!!

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Okay. Thanks for the update. Post back here if you need further assistance.

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

Similar Threads

  1. Replies: 4
    Last Post: 01-14-2013, 11:50 PM
  2. Replies: 5
    Last Post: 11-05-2012, 04:07 PM
  3. Replies: 7
    Last Post: 04-23-2012, 01:25 PM
  4. Replies: 9
    Last Post: 07-14-2011, 07:20 AM
  5. index/primary cannot contain null value
    By BinHDreW in forum Access
    Replies: 1
    Last Post: 05-26-2011, 08:25 PM

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