FROM VFP8 HELP. You may have to modify the code to use AFIELDS() function to get the name of all fields. Then it would be a FOR i = 1 to (# of fields). Look at the AFILEDS() to get that syntax. Let us know if you need more help.
CLOSE DATABASES
CLEAR
* Create new table and add blank record
CREATE TABLE employee (cLastName C(10))
APPEND BLANK
* Insert initial value
INSERT INTO employee (cLastName) VALUES ("Smith"
* Enable and set table buffering
SET MULTILOCKS ON && Allow table buffering
=CURSORSETPROP("Buffering", 5, "employee" ) && Enable table buffering
* Display initial value
=MESSAGEBOX("Original cLastName value: "+ cLastName, 0, "Results"
* Change record value and display results
REPLACE cLastName WITH "Jones"
=MESSAGEBOX("Modified cLastName value: "+ cLastName, 0, "Results"
* Store the old value of the field to cTemp variable and display results
cTemp=OLDVAL("cLastName", "employee"

=MESSAGEBOX("Original cLastName value: "+ cTemp, 0, "Results"
* Update table and display final value
=TABLEUPDATE(.T.)
=MESSAGEBOX("Final cLastName value: "+ cLastName, 0, "Results"
* Close and delete example table file
USE
DELETE FILE employee.dbf
Jim Osieczonek
Delta Business Group, LLC