>>>Why the code is not functioning?
>>>
>>>
>>>IF THISFORM.COMBO1.VALUE=ALLTRIM("RAM") OR ALLTRIM("RAHIM")
>>>INSERT INTO TESTC(NAME);
>>>VALUES(THISFORM.COMBO1.VALUE)
>>>ENDIF
>>>
>>>IF THISFORM.COMBO1.VALUE=ALLTRIM("SHYAM") OR ALLTRIM("JOHN")
>>>INSERT INTO TESTC(NAME);
>>>VALUES(THISFORM.COMBO1.VALUE)
>>>ENDIF
>>>
>>>
>>
>>If works with boolean values. ALLTRIM("RAHIM") return value is character.
>>If
>>THISFORM.COMBO1.VALUE=ALLTRIM("RAM")
>>is not true, or would cause second expression to be evaluated and would fail.
>>Probably you meant:
>>
>>if inlist(alltrim(THISFORM.COMBO1.Value),"RAM,RAHIM,SHYAM,JOHN")
>> INSERT INTO TESTC (NAME) VALUES(THISFORM.COMBO1.Value)
>>ENDIF
>>
Cetin
>
>
>Don't forget the standard warning about SET EXACT. With SET EXACT OFF values like "RAMA","JOHNNY" become "RAM" and "JOHN" for comparison purposes and could return an incorrect TRUE. That may be OK in the application, but then again................
Rich,
Alltrim(THISFORM.COMBO1.Value) was used to force exactness. RAMA,JOHNNY are not on list.
PS: Inlist was buggy however as Hugo pointed out.
Cetin