** GotFocus thisform.old_value = this.Value ** In Valid Event LOCAL ret_val, m_rec ret_val = .t. IF LastKey() # 27 && if the user press Esc IF thisform.old_value # this.Value SELECT MyTable old_record = RecNo() SEEK this.Value && To Move the pointer GOTO old_record ENDIF ENDIF RETURN ret_val *** In Error event of the TextBox LPARAMETERS nError, cMethod, nLine IF nError = 1884 && Uniqueness is violated MessageBox("Record with this value already exiists",0,"Warning") this.Value = thisform.old_value ENDIF