Let's add a new twist.

Edit the field rules for the table shown in your browse. For each field involved in the color equation we'll add an Events tab, Field event, OnWroteField and code it to commit the record each time one of those fields is changed.

Code for all the fields is the same.

if is_object("yourformname")
end if