Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Record is out of range, in a locate statement
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement