Unanswered: How do I add one number to the next record
I am working with a database that has a field which is a unique serial number in numerical order. I would like to be able to have the database automatically put the serial number in (which is always one number higher than the last. Example: 321111 next is 321112, 321113 ect.) These are the controlling document numbers and are always required in the database. Anyone know how I would be able to do this so that the number in the form opened is always the next number in line?
Dim db as DataBase, rs As RecordSet
Dim lastID as Long
Set db= CurrentDB
Set rs = db.Open("SELECT * FROM tab1 ORDER BY yourSerialNum")
SET rs = nothing: set db= nothing
I didn't test it, I just wrote it form the mind.