Results 1 to 3 of 3
  1. #1
    templeowls is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    305

    Import only new entries into main table

    So i have a table full of complaints and each has a unique "ComplaintNumber". A seperate department emails me over the new complaints each day and the excel spreadsheet literally has every complaint in there.



    I'm trying to come up with simple import procedure, and I'm getting stuck on how to import only new entries. I have it set up so that the excel spreadsheet is imported into a temp table, then an append query will add them to the main table.

    I want it to only append records where the "ComplaintNumber" is not already in the main table (aka only new complaints are added). I can't seem to figure out a way to do that.

    Any suggestions?
    TY!

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Your 'temp' tables need unique index using 1 or more fields as required. Each time run append query in vba where you turn off warnings, run append query, and turn warnings back on. If doing that, an error handler is strongly advised so that you ensure warnings are turned back on. Now you'll only get new records and the operation will be 'silent'.
    Or set index as noted, run the query/queries manually and deal with the warnings - there will be at least 2. One warning about appending, one about how many records could not be appended due to integrity violation of some sort. That can be unnerving for some users but you'll get only new records in your table.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Using a COPY of your dB (for testing):

    Off the top of my head, I would start by using the "Find Unmatched Query Wizard" to create a query that shows the new complaints (complaints in the temp table but not in the main table).
    Then use the "Find Unmatched Query" as the source of an Append query to add the new complaints to the main table.


    After you get the process working manually, then think about moving it to VBA code........

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

Similar Threads

  1. Replies: 4
    Last Post: 05-30-2020, 06:19 AM
  2. Replies: 13
    Last Post: 01-25-2016, 01:36 PM
  3. Replies: 1
    Last Post: 11-04-2015, 07:25 AM
  4. Replies: 2
    Last Post: 05-07-2015, 02:55 PM
  5. Replies: 1
    Last Post: 11-18-2013, 06:33 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