Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record is out of range, in a locate statement
Message
From
28/08/2002 14:42:00
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Record is out of range, in a locate statement
Miscellaneous
Thread ID:
00694596
Message ID:
00694596
Views:
41
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
Next
Reply
Map
View

Click here to load this message in the networking platform