Results 1 to 3 of 3
  1. #1
    Synthogy is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    1

    Create query to insert and update records from link table into new table


    Hello everyone!

    I am running a query that fetches data(records) form a linked table from another database.
    I created this piece of code that queries the data from the linked table into a new table, like this:

    Code:
    
    INSERT INTO NEW_TBL(ENT_CUS_NUM, ENT_FIRST_NAME, ENT_LAST_NAME, ENT_ADDRESS1, ENT_CITY, ENT_STATE, ENT_ZIP, ENT_PHONE) 
    
    SELECT LINK_TBL.CUS_NUM, LINK_TBL.FIRST_NAME, LINK_TBL.LAST_NAME, LINK_TBL.ADDRESS1, LINK_TBL.CITY, LINK_TBL.STATE, LINK_TBL.ZIP, LINK_TBL.PHONE FROM LINK_TBL
    Is it possible to create a query that inserts new records from the link table initially into the local table, and continuously add new records to the local table as they become available in the Link table and update existent records in the local table that have been modified in the link table?

    Example: Lets say a person changes their address, Can I update or bring over only their address without re-inserting their entire record because of an address change?

    I would appreciate your input and help.

    Thanks everyone!


    Synthogy

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    If the table is already linked, why do you need to keep the data in this database as well? One place is enough - plus it will save you the headache of keeping the two tables in sync, not an easy task. You can have a piece of code that runs in a continuous loop or on a timer that runs the relevant queries, but again, why?

  3. #3
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    If the table is already linked, why do you need to keep the data in this database as well? One place is enough - plus it will save you the headache of keeping the two tables in sync, not an easy task

    I would have to agree.

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

Similar Threads

  1. Replies: 1
    Last Post: 12-16-2011, 08:16 AM
  2. Replies: 2
    Last Post: 05-03-2011, 01:02 AM
  3. Replies: 1
    Last Post: 12-28-2010, 11:24 AM
  4. Replies: 2
    Last Post: 12-22-2010, 01:46 PM
  5. Replies: 0
    Last Post: 02-24-2010, 12:56 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