SELECT COUNT(*) KOUNT FROM MYTABLE WHERE CCode = ?cCCode INTO CURSOR crsTemp IF crsTemp.Kount > 1 * disallow the change ELSE * Then there is no other record with that code ENDIFSince you use pessimistic buffering, the result should always be exactly 1 which would be your courrent record. If the result is 2, then there obviously is another record plus the current record. If the result is more than 2, then you have other problems. In the SQL above, the parameter cCCode needs to be a memory variable name and not have a matching field name in the table. To be sure, you could always code it as m.cCCode or some other varname.