Results 1 to 5 of 5
  1. #1
    schulzy175 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Posts
    98

    Anyway to Automatically Append Records?


    I am wanting to append records from a very large linked-table to adjust for performance so I can pull the most recent records from the appended table. But in order for this to work fluidly, I am wanting to automate the records being appended to the appropriate table. Is there anyway to do this with or without code?

  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,521
    Sure, create an append query that adds the appropriate records, and execute it from vba or a macro.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    your linked table and your local table need to have one or more fields you can use to uniquely identify a record to see if you have already have that record in the local table. Then use a left join between the two tables to identify which ones have not been loaded. Something like


    Code:
    INSERT INTO localTable
    SELECT linkedTable.* 
    FROM linkedTable LEFT JOIN localTable on LinkedTable.uniqueIDfield=localTable.uniqueIDfield
    WHERE localTable.uniqueIDfield IS NULL

  4. #4
    schulzy175 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Posts
    98
    Thanks for the reply. Thankfully this is what I was doing while waiting for a response so time wasn't wasted. I have come across an issue already though. I am trying to save the changes without the save changes dialog box, but I cannot find any functions in regards to "savechanges" other than
    Code:
    DoCmd.RunCommand acCmdSave
    .

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Save what changes? Executing a query shouldn't throw that kind of message. You haven't shown your code, so maybe this is relevant:

    http://www.baldyweb.com/SQLWarnings.htm
    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: 19
    Last Post: 10-03-2017, 09:10 AM
  2. Replies: 11
    Last Post: 03-24-2016, 06:12 PM
  3. Replies: 14
    Last Post: 12-18-2015, 02:04 PM
  4. Replies: 4
    Last Post: 11-17-2015, 04:01 PM
  5. Access can't append all the records in the append query
    By fluffyvampirekitten in forum Access
    Replies: 2
    Last Post: 08-27-2015, 01:53 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