autonumber reset

zyper

Registered User.
Local time
Today, 18:32
Joined
Apr 11, 2013
Messages
14
Hello I'm still a newbie at access vba programming. I'm trying to make autonumber in this format but I dont know the sintax:
415-9/13

415 = this number is autoincrementing when I print the purchase order

9/13 = date

first number must reset every year to 1 so the first purchase order in year 2014 should look like this 1-1/14.
I would be very grateful if anyone can tell me the sintax for this.
 
AutoNumber does not serve the purpose of Custom ID's.. What AutoNumber does is promises you Uniqueness..Not incremental, not positive number.. But a different number everytime you create a record, Custom ID's normally involve CODE, a bit, a lot to capture all cases.

There should be method by RainLover - DMax+1. that should help you get started.
 
I found another way I think.
first of all this is not my primary key. My primary key is a standard autoincremented number.

I made a querry and I combined this 2 fields
[OrderNumber] & "-" & [Date] ----> 123-1.1.2013
but I have a problem I cant change the date form from dd.mm.yyyy to mm/yy
in this field. Can anybody help please.
 
Yes but where do I put this code? because I combined 2 fields in a querry calculated field
 
I dont know why but the message says that the sintax is invalid.
 
I am still unable to understand the real need for a Query here. How would you detect the New year in the Query and change it to 1?

Anyhow, show the complete Query.
 
I wanted to work just with autonumber in VBA. I would write the code for autoincremet and reset every year. And each time I save the order this number sould go in a separated field in table. Then I join the number and date together in a querry in the form we are talking about.
I'm a noob I dont know which way is the easiest, and yeah btw thank you for your time and nerves :)
 
Last edited:

Users who are viewing this thread

Back
Top Bottom