You don't need a SCAN
REPLACE email_anexo.spam with .F. FOR emails.cod = email_anexo.id
>The scan below is not running
>
>SELECT email_anexo
>
> SCAN
>
> thisform.refresh
> LOCATE FOR emails.cod = email_anexo.id
>
> IF FOUND()
> replace email_anexo.spam with .F.
> ELSE
> replace email_anexo.spam with .T.
> ENDIF
>
> ENDSCAN
--sb--