General information
Category:
Coding, syntax & commands
Title:
Record is out of range
I posted this a couple months ago, after trying all the suggestions, the error is still recurring. It happens about 10 times a month and the event fires about 6000 times a month. My users are just living with it at the moment.
I have rebuilt the indexes on all my tables.
I changed my locate statement to a Seek
Below is the offending code, the "record is out of range" error occurs at the INDEXSEEK line. bcshared is the table being searched. It has a regular key on date.Employee Number.clock-in function:
*****************************************************************
* this procedure checks to see if there is already a clockin *
*****************************************************************
LOCAL lcEmpNo, lcDate, lnNow
lcEmpNo=alltrim(thisform.empnobox.value)
lcDate=dtoc(date(),1)
lnNow=thisform.zTimeToMinutes( (Datetime()) )
If upper(right(lcEmpNo,1))=='A' and lnNow<=240
&&if second shift and time between 00:00 and 04:00 am
&&set date back one day
lcDate=dtoc( (date(year(date()-1),month(date()-1),(day(date()-1)))),1 )
endif
SELECT bcshared
LOCAL lcKey
lcKey=ALLTRIM(lcDate)+'.'+ALLTRIM(lcEmpNo)+'.'+'F1'
IF indexSEEK((lcKey),.f.,'bcshared','rkey')
RETURN .t.
ELSE
RETURN .f.
endif
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only