This has been discussed many times. I believe the common solution is to create a small database which does nothing more than track the current number and increment when queried. You need something like this to guarantee that the numbers are sequential and unique.
--
Greg Collins [InfoPath MVP]
Visit
http://www.InfoPathDev.com
I am trying to number a form in successive order counting up with every new
form, is this possible at all?