Automatically Numbering Records

  • Thread starter CCHD via AccessMonster.com
  • 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
 
G

George Hepworth

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
 
C

CCHD via AccessMonster.com

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top