>>>>>>>>>>>>
My case : I got an invoice form, invheader,invdetail ,invnumber (3
tables).
I want to lock the 'Invnumber' table , Get the newest number , then update
that tables, There are over 20 users to use this forms.
so What syntax / alog. should I write ??
Thanks in advnace.
From Agnes
>>>>>>>>>>>>
I use this code for an invoice number:
Do WHIL !LOCK("INVOICENUMBER")
Lock("INVOICENUMBER")
Enddo
Stor ALLT(INVOICENUMBER.number) to VAL1
VAL1 =VAL(VAL1)+1
VAL1 = ALLTRIM(STR(VAL1))
Sele INVOICENUMBER
REPL INVOICENUMBER.NUMBER WITH VAL1
=TABLEUPDATE(.T.)
Unlock in invoicenumber
Hope this helps