Results 1 to 4 of 4
  1. #1
    ultrarunner2017 is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    Oct 2016
    Posts
    44

    Is there a work-around for add to recordset from query that has fields from 2 or more tables

    Hi;


    This is in reference to Access 2010:
    I have been tearing my hair out trying to figure out how to get a query using fields from more than one table to produce a recordset that can be added to or updated.
    I have a database that uses a couple of lookup tables. When I run queries that use fields from both the main table and one or more of the lookup tables, I am unable to add new records to the recordset. The error is:'Cannot add record(s): join key of table ‘tablename’ not in recordset'

    I have found that if, instead of using the field from the lookup table, I use the lookup field in the main table, I don't have this problem. But that will prevent me from using the criteria to get input from the user. I don't get an error in that situation, but I get only a null recordset when I run the query - unless I enter the wildcard '*' as the search term.

    Any thoughts?
    Thanks
    FW

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    The error implies that if you include that field, the query will be updatable. Have you tried that?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ultrarunner2017 is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    Oct 2016
    Posts
    44
    Quote Originally Posted by pbaldy View Post
    The error implies that if you include that field, the query will be updatable. Have you tried that?
    Thank you very much! That solved the problem. I had tried adding the field from the main table before, but hadn't tried having both the lookup and the main table fields. Just one more reason I really need to do some studying of the manuals.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 5
    Last Post: 11-30-2016, 04:41 PM
  2. Replies: 4
    Last Post: 12-06-2014, 08:49 PM
  3. Replies: 1
    Last Post: 03-07-2014, 11:37 AM
  4. Replies: 6
    Last Post: 12-03-2013, 11:14 PM
  5. Query to Display Tables & Fields
    By foxerator in forum Queries
    Replies: 0
    Last Post: 04-24-2008, 09:57 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