Results 1 to 4 of 4
  1. #1
    DustyParnell is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2012
    Location
    El dorado, TX
    Posts
    2

    Getting an error right out the gate


    I'm running Access 2010. I was following a tutorial for 2007 (w w w.holowczak.com/access/access2007/access5.html) The Account table will not save and it gives me an error that says, "Index or primary key cannot contain a Null value". All I've done so far was to enter the Field Name, Data Type and Description - no data yet.

    I know this is a tutorial for 2007 but is there anyway to use this tutorial for 2010? I was looking for a tutorial on creating a savings account and this at first glance seemed to fill the bill.

    Thanks

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    It sounds like you did add a record but did not put a number in the PK AccountNumber field.

    I know you said you didn't add any data, but the message implies an attempt to save a data record with no value in the Primary key.

  3. #3
    DustyParnell is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2012
    Location
    El dorado, TX
    Posts
    2
    When I click on the Customer table in the left column it displays with the fields across the top and I can add data to it. I don't get this when I click on the Accounts table. It opens just as it was when I was setting it up and establishing the fields. The error message does seem to indicate that data had been added to the Accounts table, but I can't imagine how? Not that that matters because I'm new to this so anything is possible.

    How can I check to see if data has been added?

    **Edited**

    I removed the Primary Key, saved it and made an entry. I went back to the Design View and set the AccountNumber field to Primary and it saved with no errors. This seems odd to me that it would be reading it NULL even as I was setting it up. Oh well, I'm sure it'll make more sense as I go along.

    Thanks for the help.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Well it hasn't added data to the Accounts Table. I think it tried to --either you moved to a new record and Access tried to save the first record and errored on the NULL PK.

    I'm not sure where you are in the tutorial, but from what I read, the instructions were to set up relationships.
    Those relationships may force you to have a Customer table with a record, and your Accounts table will require a record that matches the Customer.

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

Similar Threads

  1. Compile Error: Syntax Error in DoCmd.RunSQL Statement
    By Evilferret in forum Programming
    Replies: 1
    Last Post: 08-27-2012, 12:32 PM
  2. Replies: 0
    Last Post: 07-16-2012, 05:42 AM
  3. Replies: 7
    Last Post: 06-08-2012, 09:55 PM
  4. Replies: 6
    Last Post: 05-30-2012, 12:32 PM
  5. Replies: 1
    Last Post: 05-11-2012, 10:59 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