inyearofbill=2000+VAL(LEFT(thisform.text1.Value,2)) inbillno=INT(VAL(SUBSTR(thisform.text1.value,4))) SELECT * from billinfo WHERE YEAR(billdate)=inyearofbill AND billno=inbillno INTO CURSOR curbilldata ************ LOCATE for YEAR(billdate)=inyearofbill AND billno=inbillno IF FOUND() thisform.text2.value=name . . . ELSE =MESSAGEBOX("not found") endif ********************thanks.
>INSERT INTO billinfo(billno,billdate) VALUES (val(right(thisform.text1.Value,4)),DATE()) >>Remember that the value showed in thisform.text1.Value, 04-0001, is ONLY ment to show nicely, it is not the actual billno.
>>INSERT INTO billinfo(billno,billdate) VALUES (thisform.text1.Value,DATE()) >>>>thanks.