>It's lAND (LAND) and not 1AND. The first sign is a lower case L, not a 'one'.
Tore
Thanks very much
Colin
>
>>>Then you should change cWhere.
>>>
>>>IF .NOT. EMPTY(comname)
>>> comname = ALLTRIM(comname)
>>> cWhere = cWhere = cWhere + IIF(lAnd," AND ","") + "globalnew.CompanyName LIKE %"+comname+"%"
>>> lAnd = .t.
>>>ENDIF
>>>
>>
>>I get the following message on this code
>>
>>variable 1AND not found - this is the 4th selection - the previous 3 have been blank
>>
>>IF .NOT. EMPTY(touncoun)
>> cWhere = cWhere + IIF(lAnd," AND ","") + "globalnew.town == '"+TRANSFORM(touncoun)+"'" && for Char Fields
>> lAnd = .t.
>>ENDIF
Specialist in Advertising, Marketing, especially Direct Marketing
I run courses in Business Management and Marketing