>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
>
>
> 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')
SWAG - have you tried removing the () from around lcKey; ie:
IF indexSEEK(lcKey,.f.,'bcshared','rkey')
> RETURN .t.
>ELSE
> RETURN .f.
>endif