Results 1 to 7 of 7
  1. #1
    jerem is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    88

    Access database engine cannot find a record

    Hi,



    I am using the Goods sample database from Microsoft. I don't know what I did but I suddenly get the message:

    "The Microsoft Access database engine cannot find a record in the table "Customers" with key field(s) "CustomerID".

    This only happens when I try to create a new Customer Order. The error message shows when the OrderDetail form opens. If I choose an existing order, the problem doesn't arise.

    I have checked many threads on various forums but nothing seems to help.

    Thanks in advance for your help!

    Cross post:
    http://www.utteraccess.com/forum/Acc...-t1995964.html
    and http://www.access-programmers.co.uk/...d.php?t=236619

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Need to review code. If you want to provide db, follow instructions at bottom of my post.

    Step debug. Review link at bottom of my post for guidance on debugging techniques.
    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
    jerem is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    88
    Quote Originally Posted by June7 View Post
    Need to review code. If you want to provide db, follow instructions at bottom of my post.

    Step debug. Review link at bottom of my post for guidance on debugging techniques.
    Here you are...

    Goods.zip

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Problem appears to be the INNER join of RecordSource for OrderDetail form. INNER join requires existing records in both tables. Change the query to:

    SELECT Orders.*, Customers.PayTerms FROM Customers RIGHT JOIN Orders ON Customers.ID = Orders.CustomerID;
    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
    jerem is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    88
    Quote Originally Posted by June7 View Post
    Problem appears to be the INNER join of RecordSource for OrderDetail form. INNER join requires existing records in both tables. Change the query to:

    SELECT Orders.*, Customers.PayTerms FROM Customers RIGHT JOIN Orders ON Customers.ID = Orders.CustomerID;

    It's working! Thanks a lot! I will revise the difference between INNER JOIN and RIGHT JOINT.

    In the meantime, I have another question regarding that database. Not sure if I can go on with this thread or should start a new one... For the moment, the tool is invoicing per order, but I would like to build the structure so that per item invoicing is possible. For example one order would have 3 invoices. The user should be able to select items to invoice and change quantities (from an invoicing form that would link to the order). The way I was contemplating that is with a new query or a buffer table but I am not yet sure on the way to build the whole thing. Any advice?

    Thank you!

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Possibly control this in report set up as invoice document. Design report to force new page after each item. Good topic for a new thread when you have specific issues with report design.

    Discretionary selection of items to invoice requires applying filter criteria. Maybe a Yes/No field in table. Invoice items checked yes?
    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.

  7. #7
    jerem is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    88
    Ok thanks! I will start a new thread with that then.

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

Similar Threads

  1. Replies: 24
    Last Post: 07-08-2013, 12:59 PM
  2. Replies: 1
    Last Post: 09-03-2011, 07:01 PM
  3. Search engine result database suggestions
    By PIHA520 in forum Access
    Replies: 0
    Last Post: 05-29-2011, 05:44 PM
  4. Replies: 6
    Last Post: 10-30-2010, 08:42 AM
  5. Replies: 1
    Last Post: 03-02-2010, 03:01 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