Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Acceptance of duplicate records
Message
From
26/06/1999 17:15:08
Charlie Davies
McIntire School of Commerce
Virginia, United States
 
 
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:
00234395
Views:
29
Heena,

First of all, you might consider not selecting into a table. You might change your code to something like this:

sele cnt(id) as dup_chk from party_master into cursor temp where party_master.p_grp = control1.value and party_master.p_code = control2.value

IF dup_chk > 0
select party_master
=TABLEREVERT(.T.)
if eof()
skip -1
endif
thisform.refresh()
ENDIF

use in alias('temp')

Also, if you have your party_master table in the dataenvironment, be sure to set the buffermodeoverride property to something that will allow you to do buffering. If you're opening up the table in code, you'll have to go a few extra steps. Look at "set multilocks on" and "cursorsetprop" and "buffermodeoverride" for more detailed descriptions.



>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