My project of the day is a Sales Budget database in Access 2000 and I need to update the information in the Budget table with info from Excel. I have most of it figured out but how to check that the to key match and update that record for the three columns.

Here is what I have so far:

VB Code:
  1. Do Until Trim(Sheet.Cells(Xo, constKEY)) = ""
  2.                 lblNote.Caption = "Uploading data " & Xo - 1 & " of " & RowCount - 2 & "..."
  3.                 Me.Refresh
  4.                 DoEvents
  5.                 'Move the row data to the TYPE Var to reduce the number of time that this aplication accesses MS Excel.
  6.                 .Key = Sheet.Cells(Xo, constKEY)
  7.                 .Revised = Sheet.Cells(Xo, constREVISED)
  8.                 .Budget = Sheet.Cells(Xo, constBUDGET)
  9.                 'Load data to db and do validation for empty strings
  10.                 Set rsAccess = New ADODB.Recordset
  11.                 sSQL = "SELECT * FROM tblBudget"
  12.                 rsAccess.Open sSQL, objAccessConnection, adOpenKeyset, adLockOptimistic
  13.                 If .Key <> "" Then
  14.                    
  15.                     With rsAccess
  16.                         .AddNew
  17.                         .Fields("Revised03").Value = Trim(RowData.Revised)
  18.                         .Fields("2004Budget").Value = Trim(RowData.Budget)
  19.                         .Fields("Changes").Value = Trim(RowData.Budget)
  20.                         .Update
  21.                     End With
  22.                 End If
  23.                 Xo = Xo + 1
  24.                 Progbar.Value = Xo
  25.                 DoEvents
  26.             Loop

after the validation for blank records I need to match tblBudget.key with rowdata.key and update the fields revised03, 2004budget and changes. right now it will add them as new, this I think just needs to be .update. Am I right there.