From: Omi on
I want to append records to tableB only when the key field in tableA does not
match the key field in tableB
From: Jeff Boyce on
Omi

We're not there. We can't see your tables or relationships.

Are you saying that you have two tables with identical structure, and you're
adding to one table only if the record isn't already in another table? If
so, why?! In a well-normalized relational database, you usually don't
need/have multiple tables with the same structure.

More info, please...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Omi" <Omi(a)discussions.microsoft.com> wrote in message
news:C6E19F9C-48B0-43E9-A9D0-E373592A8918(a)microsoft.com...
>I want to append records to tableB only when the key field in tableA does
>not
> match the key field in tableB


From: Douglas J. Steele on
INSERT INTO TableB (ID, Field1, Field2, Field3)
SELECT ID, Field1, Field2, Field3
FROM TableA
WHERE TableA.ID NOT IN (SELECT DISTINCT ID FROM TableB)

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)

"Omi" <Omi(a)discussions.microsoft.com> wrote in message
news:C6E19F9C-48B0-43E9-A9D0-E373592A8918(a)microsoft.com...
>I want to append records to tableB only when the key field in tableA does
>not
> match the key field in tableB