Public Sub UpdateTable()
Dim dbs As DAO.Database
Dim rs As DAO.Recordset
Dim rst As DAO.Recordset
Set dbs = CurrentDb
Set rs = CurrentDb.OpenRecordset("Select * from auxBancoScheda order by [SK Nº] ASC")
Set rst = CurrentDb.OpenRecordset("Select * from BancoScheda order by [SK Nº] ASC")
[COLOR="Red"]
Do while not rst.eof
rst.Edit[/COLOR]
For nIndex = 0 To 95
If rst.Fields(nIndex).Value <> rs.Fields(nIndex).Value Then
[COLOR="Red"]'
'fields aren't equal so, replace the field value in rst
'with the field value in rs
rst.Fields(nIndex).Value = rs.Fields(nIndex).Value
[/COLOR]
Else
End If
Next
[COLOR="Red"]rst.Update[/COLOR]
rst.MoveNext
rs.MoveNext
[COLOR="Red"]Loop
rs.close
rst.close[/COLOR]
Set rst = Nothing
Set rs = Nothing
End Sub