Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Dale Dedoroy
  Where is Dale Dedoroy?
 Bacolod City, Negros Occidental
 Philippines
 Dale Dedoroy
 To: chris smith
  Where is chris smith?
 Yorkshire CH CH
 Barbados
 chris smith
 Tags
Subject: RE: For Eric den Doop
Thread ID: 152 Message ID: 169 # Views: 3 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Monday, May 14, 2001 9:22:50 PM         
   


> The following is the code in the beforesave() method:-
> *****
> kf = thisform.keyfield &&Primary field in table usually unknown to the user.Not shown on the data entry form.
> kf2 = thisform.keyfield2 &&Candidate field in table usually known to the user.Shown on the data entry form.
> sele 1
> if ! empty(kf2)
> if empty(&kf2)
> return .f. &&EEEError at this point this is returning .t. all the time&&
> endif
> endif
> if empty(&kf)
> repl &kf with thisform.newid()
> endif
> if ! empty(&kf)
> return .t.
> else
> return .f.
> endif
> ***********

Hi,
I'm suspecting that maybe in one particular record, both kf and kf2 are not empty or the thisform.keyfield and thisform.keyfield2. Double check the values of these variables. You may insert the following to track the values of the vars in question:
sele 1
wait wind "kf:"+trans(kf)+space(10)+"kf2:"+trans(kf2)
if ! empty(kf2)
...

Hth,
Dale



ENTIRE THREAD

For Eric den Doop Posted by chris smith @ 5/13/2001 1:22:01 PM
RE: For Eric den Doop Posted by Dale Dedoroy @ 5/14/2001 9:22:50 PM