Dim rst1 As Recordset
Dim tdfTable As TableDef
Dim strQuery As String
...
strQuery = "INSERT INTO [" & strArchiveTable & "]" & _
" SELECT * FROM [" & strProductionTable & "]" & _
" WHERE " & "[" & tdfTable.Fields(1).Name & "] =" & lngID 'field(1) is always the Foreign Key field in this db
On Error Resume Next
CurrentDb.Execute strQuery, dbFailOnError + dbSeeChanges '<-ODBC connection error from this statement
|