I am importing data from excel into a temporary table (tblImportClientInfo). Then I am running an update and append query with tblClientInfo and tblImportClientInfo linked on ClientID:
I get key violations for all records that already have existing clientid's in tblClientInfo, even if there is a spelling change in the name, or change in DateOfBirth. If I say yes, I want to continue I will get new information appended, but no updates.
My understanding from the Northwind example is that I should be able to update the name changes, etc using this method. Is it possible that there is something in the import method I am using that is interfering?
I have tried manually adding information to tblImportClientInfo. I then run the update/append query to add the new info to tblClientInfo. Once the information is added, if I go back and make a change to that entry in tblImportClientInfo and rerun the update/append query, I still get the key violation on the original entries, but not on the new information. The query will update the changes to the new entry in tblClientInfo. It just doesn't work on the data imported from Excel.
All help is greatly appreciated!
Code:
UPDATE tblClientInfo RIGHT JOIN tblImportClientInfo ON tblClientInfo.ClientID = tblImportClientInfo.ClientID SET tblClientInfo.ClientID = tblImportClientInfo.ClientID, tblClientInfo.EnrolledLastName = tblImportClientInfo.EnrolledLastName, tblClientInfo.EnrolledFirstName = tblImportClientInfo.EnrolledFirstName, tblClientInfo.DateOfBirth = tblImportClientInfo.DateOfBirth, tblClientInfo.LangID = tblImportClientInfo.LangID, tblClientInfo.SpecialNeeds = tblImportClientInfo.SpecialNeeds;
I get key violations for all records that already have existing clientid's in tblClientInfo, even if there is a spelling change in the name, or change in DateOfBirth. If I say yes, I want to continue I will get new information appended, but no updates.
My understanding from the Northwind example is that I should be able to update the name changes, etc using this method. Is it possible that there is something in the import method I am using that is interfering?
Code:
Dim strTable As String
Dim strRange As String
strTable = "tblImportClientInfo"
strRange = "a1:f23"
DoCmd.TransferSpreadsheet acImport, , strTable, "c:\mstrenrl.xls", True, strRange
I have tried manually adding information to tblImportClientInfo. I then run the update/append query to add the new info to tblClientInfo. Once the information is added, if I go back and make a change to that entry in tblImportClientInfo and rerun the update/append query, I still get the key violation on the original entries, but not on the new information. The query will update the changes to the new entry in tblClientInfo. It just doesn't work on the data imported from Excel.
All help is greatly appreciated!