function UpdateField local loError, llReturn llReturn = .t. try use myTable in 0 alias ToEncrypt exclusive && Do we really need to use table exclusive? catch to loError llReturn = .f. endtry if m.llReturn try replace all myField with Encrypt(myField) in ToEncrypt catch to loError llReturn = .f. && At this point some of fields could be encrypted, some not - perhaps it's better to buffer the table and do tableupdate instead endtry endif return m.llReturnHere is a quick sample - you may implement better error handling and also handle this using table in buffered mode...