• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 344
  • Last Modified:

Append table without duplicate value

I am using the following codes to append table 1 to table 2.

CurrentDB.Execute "INSERT INTO tbl_Data2 (field1, field 2, field 3) SELECT [Valume1], [Valume 2], [Valume 3] FROM tbl_Data1", dbFailOnError

But it creates duplicate data in table 2. How can I set filter to append only record that have field 1 and filed 2 are not into table 2?

1 Solution
Rey Obrero (Capricorn1)Commented:

test this

INSERT INTO tbl_Data2 ( Field1, field2, field3 )
SELECT tbl_Data1.[valume 1], tbl_Data1.[valume 2], tbl_Data1.[valume 3]
FROM tbl_Data1 LEFT JOIN tbl_Data2 ON (tbl_Data1.[valume 1] = tbl_Data2.field1) AND (tbl_Data1.[valume 2] = tbl_Data2.field2)
WHERE (tbl_Data2.field1) Is Null AND (tbl_Data2.field2) Is Null
What are you waiting for, didn't capricorn1's comment solve your problem!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now