Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6628611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:08:42+00:00 2026-05-25T22:08:42+00:00

I have an append query that is trying to append some records to one

  • 0

I have an append query that is trying to append some records to one of my tables. However, I am getting an error that says “didn’t add 1200 records due to key violations.” 1200 is the total number of records I am trying to append. I don’t understand why I am getting this error because all of my columns in the destination table allow duplicates (even though this append query doesn’t duplicate any information), and if I copy the structure of the table and append the records to that, everything works.

The problem seems to be that I am appending data to a table which already has existing data. Can someone please offer some suggestions for how I can work around this?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T22:08:43+00:00Added an answer on May 25, 2026 at 10:08 pm

    Verify you haven’t overlooked any unique indexes on your table. Save this procedure in a standard module and call it from the Immediate Window with the name of your destination table.

    Public Sub InspectIndexes(ByVal pTable As String)
        Dim db As DAO.Database
        Dim i As Long
        Dim j As Long
        Dim strFields As String
    
        Set db = CurrentDb
        With db.TableDefs(pTable)
            Debug.Print "Indexes.Count = "; .Indexes.Count
            For i = 0 To (.Indexes.Count - 1)
            With .Indexes(i)
                Debug.Print i + 1 & ": Index Name = "; .name
                If .Primary Then
                    Debug.Print vbTab & "Primary Key (Unique)"
                Else
                    Debug.Print vbTab & "Unique: "; .Unique
                End If
                Debug.Print vbTab & "Fields.Count = "; .Fields.Count
                strFields = vbNullString
                For j = 0 To (.Fields.Count - 1)
                    strFields = strFields & "; " & .Fields(j).name
                Next j
                strFields = Mid(strFields, 3)
                Debug.Print vbTab & "Fields: "; strFields
            End With
            Next i
        End With
    
        Set db = Nothing
    End Sub
    

    Here is sample output where tblFoo has 3 indexes: primary key (unique by definition) on id; a unique index on num_field1 and num_field2; and a non-unique index on parent_id.

    InspectIndexes "tblfoo"
    Indexes.Count =  3 
    1: Index Name = both_num_fields
        Unique: True
        Fields.Count =  2 
        Fields: num_field1; num_field2
    2: Index Name = parent_id
        Unique: False
        Fields.Count =  1 
        Fields: parent_id
    3: Index Name = pkey
        Primary Key (Unique)
        Fields.Count =  1 
        Fields: id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a working query that will return some results(records) from my database, like:
Im trying to query the Netflix OData feed. I have the following query that
I have two tables, testInstance and bugzilla that are associated by a third one,
Right now I have one query that returns a list of results and displays
I have a small code block that should append text to the beg of
I have a directory of files that I'd like to append file extension to
I have a QGraphicsScene that I want to copy and append to the start
I have an existing XML file that I would like to append without changing
I have some API instructions I am trying to follow (string) source (string) key
I have a block of HTML that I am parsing with Jsoup, however, not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.