Well, as I suspect we have linked fields on [NR_adv] we can't just delete the information and import the table; thus, as I stated in post #2 you will need two queries, one of which will be the unmatched as Seth stated.
The query wizard actually doesn't do too bad a job on building the unmatched query... let it do that for you.
Once built, run once to make sure it returns the unmatched records from "tbl_adviseurs", if so, then switch to design mode, look at the ribbon, query type group, a red-X with an exclamation point (bang) - this is a run as delete. Click this, it will change the select to a delete query... now click on the run (just the red Bang)
I do this in two stages by hand just to be sure I have things correctly.
You can save this query as a delete query if you like and then the next time all you have to do is click on it in the navigation pane to run it... I personally don't like doing that - but that's me.
As for your update...
Open your update query in design mode...
Is there a join between the [NR_adv] fields for "Import_adv" and "tbl_adviseurs"?
You need to edit this relationship so right click...
You need to select the option so that
all of the records from the transfer table (import_adv) are returned and the matching records from "tbl_adviseurs".
If you do not have this relationship then you need to create this relationship (left click and drag [import_adv]![NR_adv] over to [tbl_adviseurs]![NR_adv].... now right click the line and select the option to
return all records from [import_adv] and matching records)
Your SQL should look something like this:
(now the field names will not be the same)
(tbl_people.people_pk = tblstaff.staffid are the related fields)
- UPDATE
-
tbl_people LEFT JOIN
-
tblstaff ON
-
tbl_people.people_pk
-
= tblstaff.staffid
-
SET tblstaff.staff_FirstName
-
= [tbl_people]![people_FirstName]
-
, tblstaff.staff_LastName
-
= [tbl_people]![People_LastName]
-
, tblstaff.staff_email
-
= [tbl_people]![people_email];
(of course, in the sql view this will be all on one or two lines.)
and Bob's Your Uncle, you should be done.
Once these queries are running correctly, you can automate the process by creating either VBA or Macro code to call each query... I prefer VBA as I'd do a double check for stuff.