Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Acceptance of duplicate records
Message
 
 
To
25/06/1999 23:32:14
Heena Sampat
Fairbyte Computer Consultants
Mumbai, India
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00234286
Message ID:
00234293
Views:
23
If you wanted to check for duplicates in party_master. You could do the following. If the new codes are in memory variables and haven't been added to the table yet you could check

* lnCode, lnGrp are the values to add
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
>master for creating selecting 2 chars from party-group[via combo]
>and new 3 char codes.
>while accepting the partyname in gotfocus I check for duplicates.
>
>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 -
> [still new to vfp]
>
>kindly help
Previous
Reply
Map
View

Click here to load this message in the networking platform