>>SELECT * ;
>> FROM loadfile, client ;
>> WHERE NOT EMPTY(loadfile.searchstr1) ;
>> AND UPPER(ALLTRIM(loadfile.searchstr1)) $ ALLTRIM(UPPER(client.company))
>>
Maybe the problem is that both terms of the 'where' clause are being evaluated i.e. the search in is still performed even if loadfile.searchstr1 is empty. Then every record would match (probably). I am aware that VFP evaluates IF terms in order, and stops if the condition isn't met without further testing, but in SQL a different rule might apply. I believe VB's tests don't stop - all conditions are checked.
Possibly if you split the statement into two and create an initial cursor:
Select * from loadfile WHERE NOT EMPTY(loadfile.searchstr1) ;
into cursor curLF1
and then you join this to the second file, it will avoid the problem.
Mike
Regards
Mike