Code:
'Add fields to existing tables
Set dbs = OpenDatabase(dbPath)
Set tdf = dbs.TableDefs("States")
Set fld = tdf.CreateField("txtCountry", dbText, 50)
tdf.Fields.Append fld
dbs.TableDefs.Refresh
dbs.Execute "Update States set txtCountry = 'US';"
' Load the new states
dbs.Execute "Inert into States (shortstate, longstate, txtCountry) " _
& "Select tblStates.shortstate, tblStates.longstate, tblStates.txtCountry from tblStates;"
dbs.Execute "Drop table tblStates"
dbs.Close
The code is properly adding tblStates to the dbPath database, adding txtCountry to the States table, updating the txtCountry for existing rows to 'US' and dropping the temporary table but it isn't loading the new rows from the tblStates table into States. I've confirmed that the property types match, including string length. Any ideas?
Thanks
Lution