Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Record is out of range, in a locate statement
Message
De
28/08/2002 14:42:00
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Record is out of range, in a locate statement
Divers
Thread ID:
00694596
Message ID:
00694596
Vues:
40
I have a form which reads input from a barcode wand. One of my methods contain code that checks to see if an employee has already clocked in. Periodically i am getting an error: "record is out of range" What can I do to avoid this?
It is occuring in the locate statement below (line 17)....

*****************************************************************
* this procedure checks to see if there is already a clockin *
*****************************************************************
cEmpNo=alltrim(thisform.empnobox.value)
cPayEmpNo='E'+substr((cEmpNo),3)
lClockedIn=.f.
cDate=dtoc(date(),1)
nNow=thisform.zTimeToMinutes( (Datetime()) )
If upper(right(cEmpNo,1))=='A' and nNow<=240
&&if second shift and time between 00:00 and 04:00 am
&&set date back one day
cDate=dtoc( (date(year(date()),month(date()),(day(date())-1))),1 )
endif

SELECT bcshared
set order to forg_date descending
locate for forg_date=(cDate) and alltrim(fnction)=='F1' and alltrim(fempno)==(cEmpNo)
if found()
lClockedIn=.t.
endif

return lClockedIn
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform