Yeah i'd do the same as above, however with that serial number, i would "SELECT Serial FROM dbtable" which gives you
MM010307002
MM010307003
then run a function to grab the last 3 digits, then gra the biggest one..
Or, if you want a cleaner way of storing this serial number, maybe store the parts to the serial number in different coloumns, Say...
Code Date AutoNum
MM 100107 0001
MM 101010 0002
Then to get the next number use SQL : "SELECT MAX(AutoNum) FROM dbtable" (then add one to it....