Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format an autonumber field to show year + increasing number

Status
Not open for further replies.

NerdyOne

MIS
Oct 16, 2001
50
US
How do I format an autonumber field to show the year plus an number that increases for each new record. I've tried typing the format as yyyy but it does not display the year correctly.

Basically, the field is Receipt_NO and I want each new record to have a unique receipt number that is something to the effect of 20040001; 20040002; 20040003, etc. Thank you in advance for any help that you may offer.
 
have a look at Micheal Reed FAQ700-184 it might help

Hope this helps
Hymn
 
Update!

I discovered an answer to my problem. I wanted the autonumber to include the current year plus a certain number of digits that would be my receipt number. In format box simply type in the current year plus the # symbol (example: 04#######). Windows automatically converts it to the needed format of 0\40000000.

If you don't mind having to go in and change the current year digits every year then this is a quick and easy fix!
 
NerdyOne
Going in and changing the current year digits every year can get to be a bit of a pain. If you are interested in another way, here's one.

Assuming that the Receipt # is used on a report (a receipt), leave the AutoNumber and its format alone, and then combine the AutoNumber and Year in the receipt report, by putting the following formula in a text box...
=Year(Date()) & Receipt_NO

The receipt for each new record would then always carry the current year plus the AutoNumber
Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top