Option Compare Database
Option Explicit
Sub UpdateTable1()
[B][I][COLOR="SeaGreen"]'Add 2 fields RPM & FEED to Table1[/COLOR][/I][/B]
[COLOR="seagreen"][B][I]'If both are integer number fields use this[/I][/B][/COLOR]
CurrentDb.Execute "ALTER TABLE Table1 ADD COLUMN RPM INT, FEED INT;"
[COLOR="seagreen"][B][I]'if FEED is a number field with decimal places e.g. 16.35, remove the above and uncomment this line[/I][/B][/COLOR]
CurrentDb.Execute "ALTER TABLE Table1 ADD COLUMN RPM INT, FEED DOUBLE;"
[COLOR="seagreen"][B][I]'otherwise remove the above lines & uncomment the line below [/COLOR]
'this gives a field size of 10, adjust as appropriate[/I][/B]
'CurrentDb.Execute "ALTER TABLE Table1 ADD COLUMN RPM INT, FEED TEXT(10);"
[COLOR="seagreen"][B][I]'Now update the 2 new fields in Table1 from Table2[/I][/B][/COLOR]
CurrentDB.Execute "UPDATE Table1 INNER JOIN Table2 ON Table1.ID = Table2.ID" & _
" SET Table1.RPM = [Table2].[RPM], Table1.FEED = [Table2].[FEED];"
End Sub