Very similar questions have already been asked, but the difference I can't find an answer to is, I want to import excel data into an existing table, but to add extra fields to the records already there, not to add extra records.
For example, in my Access table 'Recruits', I have ID's A1, A2, A3, A4 & lots of data associated with them. But we forgot to put some fields in when we created the table, & now have that extra data in an Excel spreadsheet, which I've imported into a new Access table. This new table 'Import Data' might have records A2 & A4 & I want to the extra data I have for them to add to their records in the Recruits, not create new records.
I found this thread about writing an Append query
, which included suggested code:
INSERT INTO tblUser ( UserID, UserName, Category, Admin, Custodian )
SELECT Userupdate.UserID, Userupdate.Username, Userupdate.Category, Userupdate.Admin, Userupdate.Custodian
FROM Userupdate LEFT JOIN tblUser ON Userupdate.userID = tbluser.UserID
WHERE (((tblUser.UserID) Is Null));
But when I tried to convert that to my situation (change field & table names & left off the WHERE statement), it added extra records with IDs A2, A4, so I have two A2 & two A4 records, rather than one record of each with new fields on them. I'm guessing an Append query is the way to go, its just a matter of telling it to add fields to existing records rather than add new records. The ID's A2, A4 etc are not the keys of the records, there can be duplicates, but I don't want there to be).
Can anyone help refine the query?