This example opens Employee.dbf (a dBASE IV table located in the C:\Program Files\Microsoft Office\Office folder), finds a record with the EMPLOY_ID value 555, and then sets the REPORTS_TO field to the value in cell B2 on Sheet1.
Sheets("Sheet1").Activate
Set categoryCell = ActiveSheet.Cells(2, 2)
categoryCell.Value = "777"
Set db = OpenDatabase("C:\Program Files\Microsoft Office\Office", _
False, False, "dBASE IV")
' create a temporary index
Set td = db.TableDefs("Employee")
Set idx = td.CreateIndex("EMPLOY_ID")
Set fld = idx.CreateField("EMPLOY_ID", dbInteger, 255)
idx.Fields.Append fld
td.Indexes.Append idx
' change the record
Set rs = db.OpenRecordset("EMPLOYEE.DBF", dbOpenTable)
With rs
.Index = "EMPLOY_ID"
.Seek "=", "555"
.Edit
.Fields("REPORTS_TO").Value = categoryCell.Value
.Update
End With
MsgBox "The field has been updated with " & categoryCell.Value
rs.Close
' delete the temporary index
td.Indexes.Delete "EMPLOY_ID"
db.Close