Automatically Numbering Records

  • Thread starter Thread starter CCHD via AccessMonster.com
  • Start date Start date
C

CCHD via AccessMonster.com

I'm new to MS Access.

I need help to automatically number a field sequentially without using
AutoNumber. The format of the numbering is four digits “0000â€.
And "9999" maximum is more than enough.

If possible provide step-by-step directions.

Thank You
 
You can use the DMax Function to retrieve the largest last used number from
this field in your table and use that value (+1, of course) as your next
value when you create a new record.

You want step-by-step directions, but that is virtually impossible without
reference to the actual environment in which you are operating.

You could, for example, place this in the Before_Insert Event of the form
through which new records are inserted into the database.

Me.txtYourAutoNumberField = Dmax("YourAutoNumberField", "tblYourTable")+1

HTH

George
 
George

When in refer to "YourAutoNumberField", do you mean the actual AutoNumber
field?

Thanks

George said:
You can use the DMax Function to retrieve the largest last used number from
this field in your table and use that value (+1, of course) as your next
value when you create a new record.

You want step-by-step directions, but that is virtually impossible without
reference to the actual environment in which you are operating.

You could, for example, place this in the Before_Insert Event of the form
through which new records are inserted into the database.

Me.txtYourAutoNumberField = Dmax("YourAutoNumberField", "tblYourTable")+1

HTH

George
I'm new to MS Access.
[quoted text clipped - 5 lines]
Thank You
 
Back
Top