It's impossible for me to tell you where you shall include my code, or your own variant of it. My message to you was that you must re-think WHEN you generate the bill number, you can not do that in advance without a lot of work, you must do it last!
>hi,
>
>how i can use your fuction at my form ,
>i mean how i can call the function via myform,
>i have two tables (temp and mstr)
>wher i can put(replace) my tables at your function.
>
>thanks.