I have 2 tables. I need to update Table1 with info from Table2 joined by a common field.
I have tried an UPDATE INNER JOIN ON SET query but does not work when updating more than one field. Any ideas?
Example:
DoCmd.RunSQL "UPDATE TBL_VINList_Main INNER JOIN TBL_Temp_Import ON TBL_VINList_Main.MAI_PK_Number = TBL_Temp_Import.F2 SET TBL_VINList_Main.MAI_VIN_17 = [TBL_Temp_Import].[F1], TBL_VINList_Main.MAI_Model_Number = [TBL_Temp_Import].[F3], TBL_VINList_Main.MAI_Model_Year = [TBL_Temp_Import].[F4], TBL_VINList_Main.MAI_Exterior_Color = [TBL_Temp_Import].[F5], TBL_VINList_Main.MAI_Interior_Color = [TBL_Temp_Import].[F6], TBL_VINList_Main.MAI_Country_Code = [TBL_Temp_Import].[F7];"
This will only update the MAI_VIN_17 Field....Both tables have the same field properties.
I have tried an UPDATE INNER JOIN ON SET query but does not work when updating more than one field. Any ideas?
Example:
DoCmd.RunSQL "UPDATE TBL_VINList_Main INNER JOIN TBL_Temp_Import ON TBL_VINList_Main.MAI_PK_Number = TBL_Temp_Import.F2 SET TBL_VINList_Main.MAI_VIN_17 = [TBL_Temp_Import].[F1], TBL_VINList_Main.MAI_Model_Number = [TBL_Temp_Import].[F3], TBL_VINList_Main.MAI_Model_Year = [TBL_Temp_Import].[F4], TBL_VINList_Main.MAI_Exterior_Color = [TBL_Temp_Import].[F5], TBL_VINList_Main.MAI_Interior_Color = [TBL_Temp_Import].[F6], TBL_VINList_Main.MAI_Country_Code = [TBL_Temp_Import].[F7];"
This will only update the MAI_VIN_17 Field....Both tables have the same field properties.
Last edited: