I would like to import a dbf table (FoxPro) into a temporary MS Access table and copy 2 columns into a final one before deleting the temp one.
My code looks like this
'read all data into temp table
DoCmd.TransferDatabase acImport, "ODBC Database", DSNCONNECTIONSTRING, acTable, "BEL_PLZ", "Belegungsplaetze_Temp", False
'update table
With CurrentDb
.Execute "INSERT INTO Belegungsplaetze (Belegungsplatznr,Bezeichnung) " & _
"SELECT NR,BEZ FROM Belegungsplaetze_Temp t " & _
"WHERE NOT EXISTS(SELECT 1 FROM Belegungsplaetze s " & _
"WHERE t.NR = s.Belegungsplatznr) "
.Execute "UPDATE Belegungsplaetze SET Belegungsplatznr = Trim([Belegungsplatznr]);"
End With
The problem I'm facing is that the column NR from Belegungsplaetze_Temp is a string and I would like to have it as an integer in my final table (final table has 2 columns Belegungsplatznr = Int and Bezeichnung = short text)
Val(NR)support.office.com/en-gb/article/… alternatively can convert to a specific numeric type using one of the functions on this page: support.office.com/en-us/article/…