I've been running an update query for months without issue. Today I started getting key violation errors and it will not perform the update.
UPDATE tblExHist RIGHT JOIN tmpEXCPTDWN ON tblExHist.ExHistID = tmpEXCPTDWN.ExHistID SET tblExHist.ExHistID = tmpEXCPTDWN!ExHistID, tblExHist.ExDate = tmpEXCPTDWN!ExDate, tblExHist.Type = tmpEXCPTDWN!Type, tblExHist.ChrgGtwy = tmpEXCPTDWN!ChrgGtwy, tblExHist.Code = tmpEXCPTDWN!Code, tblExHist.Discrepancy = tmpEXCPTDWN!Discrepancy, tblExHist.ActionTaken = tmpEXCPTDWN!ActionTaken
WHERE (((tmpEXCPTDWN.ExDate)>=[Forms]![frmUpdEx_Comp]![txtUpdBeginDate] And (tmpEXCPTDWN.ExDate)<=[Forms]![frmUpdEx_Comp]![txtUpdEndDate]));
tmpEXCPTDWN is a temp table which has the most current data for the records. The query is supposed to add new and update existing records in tblExHist. ExHistID is PK in both tables (it is a text field); there are no duplicate records. Currently it's adding new records, but it is not updating the existing records due to key violation. What could be the reason?