lparameter lcValue && character value to check local lcOldExact lcOldExact=set('exact') && Save current settings set exact on && To perform exact match if !empty(this.CursorName) and !empty(lcValue) and type('lcValue')='C' && Character field if seek(lcValue,this.CursorName, 'Code') && Check if it's duplicate =messagebox('There is a duplicate! '+lcValue+ ' will not be added!',48,'Warning') return .f. endif endif set exact &lcOldExact && Restore old settings return .t.There lcValue is already alltrimed.