Does the user need to do anything with the number? Do they ever see that data or is it hidden?
Don't assign this data until after these requirements are met:
1) the user submits the form
2) the form passes any required validation checks
Then, and only then, you should:
3) assign the incremental number at the time of insertion into your database
That is really the only way to do it to avoid skipping numbers and prevent users from duplicating the assigned number.
Philip
------------------
Limecat is not pleased.
Don't assign this data until after these requirements are met:
1) the user submits the form
2) the form passes any required validation checks
Then, and only then, you should:
3) assign the incremental number at the time of insertion into your database
That is really the only way to do it to avoid skipping numbers and prevent users from duplicating the assigned number.
Philip
------------------
Limecat is not pleased.