Don't assign the number until you actually save the data. Look at the primary key article on my web site for a method to get unique values.
>Hello, i have this problem i have a desktop which it's used by 20 users which generate tickets with the database, one of the fields of the table is autonumeric and primary, but exists a problem, if two users (or more) press the add new button it shows the same number of the ticket and when one of them press the save button to one of them shows a error message of duplicity.
>
>How can i solve this?
>
>Thanks for the support.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer