>>>I have a form where I want to check if a value is already in the tabke. Because of what I am doing I check as get to next field (also want to check in save button). I use INDEXSEEK(value), SEEK(value), or LOCATE FOR field = value it always seens to return .T. (found the value) even when it is not in the table. If I do the same thing from the command window it works as expected.
>>>
>>>What am I missing?
>>>
>>>TIA
>>
>>Post your code. It could be either corrupted index or wrong SET EXACT settings...
>
>I deleted the code and retype it. It works as expected now. I have no idea why it did not work before.
>
>my code has the in the gotfcosus method is
>
>llfound = INDEXSEEK(lccid)
>
>IF llFound AND lcCID <> gCID
> =msgfrm(SPACE(4) + 'User ID ' + lcCID + ' already exists.' + ;
> CHR(10) + SPACE(10) + 'Re-enter or Revert.' ;
> ,'0',,'S','Existing field value',0,gnMsgWait)
> KEYBOARD '{LEFTARROW}'
> RETURN
>ENDIF
>
>I used debug to see the values
Sorry
KEYBOARD '{LEFTARROW}' should be Thisform.CID1.Setfocus