SELECT * FROM party_master WHERE lnCode p_grp = lnGrp and p+code = lnCode INTO CURSOR cMatchs IF _TALLY > 0 && duplicates exist =messagebox("Duplicate found!") * do something ELSE =messagbox("No duplicates found!") * do something else ENDIF>I had created party-group for accepting 2 char grp codes and party
>sele party_master >sele party_master.p_grp,party_master.p_code from party_master into table temp >sele temp >index on p_grp + p_code TAG p_grp >seek party_master.p_grp + party_master.p_code >if found() > wait window "Cannot enter duplicate code" > thisform.p_code1.setfocus >endif found >if .not. found() > sele party_master > repl party_master.p_grp with party_grp.p_grp > repl party_master.p_codd with party_master.p_grp + party_master.p_code >endif not found >>even then it accepts the duplicates -