Mohammed
You got answers that will work but you are not asking the right question.
Don't use MAX() to get the next number. It is better to generate next number.
Have a table with generated numbers newid.dbf
Table Number
MSTR 15
use newid
locate for table="MSTR"
RLOCK()
replace number with number + 1
m.lnnumber = number
unlock
The new number is in m.lnnumber (16).
>hi,
>thank you very much,
>
>i get the solution from mr.tore bleken and mr.fabio lunardon,
>
>anyway thanks all.
>best regards.
>m.qasem