Results 1 to 2 of 2
  1. #1
    Buakaw is offline Absolute novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    112

    Adding a record not found in another table.

    Hi,


    I have 2 tables, Table A and B. Table A contains the primary key (pkID) and names of people. (FirstName, LastName)

    Table B contains the primary key (pkTransactionID) to identify unique transactions made, and a foreign key (fkPersonID) to identify the person who made these transactions. fkPersonID is linked to pkID from Table A.

    I need to find a way (using a query or otherwise) to look for entries that are in table A (pkID) that does not have a corresponding entry in table B (fkPersonID).

    Once I find it, I need to insert a new record into Table B with the fkPersonID that is missing.

    How can I achieve this please? If this is better achieved in VBA, would also appreciate any sample code you can provide for reference. Thanks.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I would start by using the "Unmatched query wizard" for the first part and then build on it.

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

Similar Threads

  1. Replies: 3
    Last Post: 10-28-2010, 07:02 AM
  2. Adding table to Query removes every 4th record
    By CoachBarker in forum Queries
    Replies: 1
    Last Post: 10-13-2010, 07:23 AM
  3. Re: Adding a new record to a joined table
    By Mcdodre in forum Access
    Replies: 4
    Last Post: 06-30-2010, 12:07 PM
  4. Replies: 1
    Last Post: 03-29-2010, 04:11 AM
  5. Need help on transferring found record
    By awsmitty in forum Access
    Replies: 1
    Last Post: 01-22-2010, 09:11 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