THere is nothing in the code to account for multiple users. Look at the Primary Code article on my web site as the idea is the same as what you want to do.
>Hello Sergey,
>
>I am using the below code in the add button to get the next sequence number from the database table but it is not working properly.
>It is getting the sequence number which is already there in the table.
>
>Could you please tell me is there any other way to call the next good sequence number from table which does'nt exist.
>
>this is the code i am using
>***********************************Start************************************
>SELECT Docindex
> * set the sort order.
> SET ORDER TO PJWPToFrom DESCENDING
> SET NEAR ON
> SEEK cProject_no+cWorkpkg_no+cToFrm
> IF FOUND()
> thisform.container1.sequence.value = INT(docindex.sequence+1)
> thisform.container1.sequence.setfocus
> ELSE
> thisform.container1.Sequence.value = 1
> thisform.container1.Sequence.setfocus
> ENDIF
>
>*****************************end*********************************************
>
>Thank you very much Sergey.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer