Autonumber in Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a number of different groups of data in the one table. Each group has
a range of numbers for each group (It is also the primary key). I want to
enter new data through a form and i want the number to continue on from the
previous number depending what section your entering to. The numbers are 8 -
10 digits long.
Is there a way,
IF one (section) is picked
THEN it will automatically choose the correct section of numbers and
Autonumber will update or increment the value by 1.
 
Autonumber is not the best solution for this. You cannot rely on autonumber
to sequentially number without gaps. (In fact, you can *count* on it
developing gaps). A better solution is to use the DMax Domain aggregate
function to return the highest used number and increment it.

On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "AutonumberProblem.mdb" which illustrates how to do this.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Back
Top