Mohammed,
Are you trying to use this code to generate the next primary key value? If so it won't work in a multiuser system, or if a single user can open your form more than once. You should look at using an autoincrement field, or use a function that uses a key table to generate unique key values. I'm pretty sure there is a version of this function in the VFP sample app. There is probably one or two versions in the files section here too.
>if i start now to insert my first bill
>i want to get billno=1 at my THISFORM.TEXT1.VALUE ,
>.
>i try to change as
>1.IF _TALLY >= 0
>2.IF _TALLY > 0 or _TALLY =0
>i get error message (laArray is not found),
>
>
>
>this code works exellent but if i have at least one bill at my table
>SELECT MAX(BILLNO) FROM mstr INTO ARRAY laArray
>IF _TALLY > 0
> THISFORM.TEXT1.VALUE = laArray + 1
>ENDIF
>