Update Query

dbay

Registered User.
Local time
Today, 03:03
Joined
Jul 15, 2007
Messages
87
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.
 
Last edited:
Works perfect for me... :confused:

Maybe information in:
TBL_VINList_Main.MAI_PK_Number
don't match information in:
TBL_Temp_Import.F2 ?
 

Users who are viewing this thread

Back
Top Bottom