How to create reset a autonumber after every Year

rahulmanekar

New member
Local time
Today, 17:19
Joined
Feb 12, 2007
Messages
8
How to create or reset a autonumber at the start of new Year

Hi I am trying to make a database, In which I have a table linked with the form.
There are two fields in the table 1.Serial Number & 2. Current Year
I want the serial No. field to be incremented after every record is added & Also the numer should start from "1" again as the Current Year Changes.
Can somebody help me in this.
I am learning new things in access & not that proficient. But i love to work in access.
 
Last edited:
Thanks for that, but it only gives you how to generate a autonumber. What should I do to get the number starting again from "1" at the start of every new year.
 
Hi, I tried that but didn't worked. Pls find the post with follwing discription.

Restarting Custom # Each Year Using Dmax function

This is what I want. Can you help me?
 
There should be NOTHING you have to do if you get a given year to increment.

That is, if you use properly delimited and selective DCount, then the next number is ALWAYS

1 + DCount( "[year]", "mytable", "[Year]=[EntryYear]")

assuming that you have a year in the entry you are about to make. The moment you make an entry for a new year, DCount returns 1. It automatically starts over again.. You have NOTHING SPECIAL to do as long as you design the structure right.
 
Help me please, Mr Rahulmanekar

I want this in my database i.e., the autonumber field should start from No.1 every year. I am not familiar with VB or SQL. Would you please explain how to write the code where to put etc. Shall be grateful.
 
This is a 14 year old thread - suggest start you own thread as your request is different to the original question
 
Here's an example. It is a little more complicated than your request so post back if you have questions.
Pat o/p has started own thread.
 
Last edited:
You never answered any of the questions I asked in the other thread about whether this was existing data that you were converting or perhaps an input file you get from some other place. You didn't even respond to my question regarding whether you wanted to use this in an append query or if you were intending to use it in a select query.
 
You never answered any of the questions I asked in the other thread about whether this was existing data that you were converting or perhaps an input file you get from some other place. You didn't even respond to my question regarding whether you wanted to use this in an append query or if you were intending to use it in a select query.
So sorry if I didn't reply or see your questions.
1- Yes it was existing data not an input file.
2- It's a select query not an append query.
Just simple data need to be incremented and reset at every start of the month
 

Attachments

  • Increment.png
    Increment.png
    6 KB · Views: 141

Users who are viewing this thread

Back
Top Bottom