You need a table to keep track of the year and bill number, I suggest you use one field for each. If you already have a field with the date, let's say you call it invdate, you can use invyear=date(invdate), and you don't need a seperate field for the year. The billno you must increment programmatically.
>hi,
>i try with this code under it works,how i can do that autamtic serial
>
>LOCAL invyear,billno
>invyear=4
>billno=1
>thisform.text1.value=RIGHT(STR(1e5+BillNo,6),4)+'-'+RIGHT(STR(invYear,4),2)
>
>
>best regards.
>>>m.qasem