Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Microsoft Office Access 2007

Jan 11, 2011 11:50PM PST

I am trying to create an autonumber, but i want to modify it. I work for a family owned business in the service industry, and we need a database for all the quotes for the jobs we do. i would like the primary key to be a number that shows the year the quote was issued, then an autonumber. for eg. 2010-001 or 2010-1. so that at the beginning of every year it starts back at 1. is this just wishful thinking? or is it possible? please help. i have access 2007 running on vista. thanks in advance.

Discussion is locked

- Collapse -
Re: autonumbering
Jan 12, 2011 3:27AM PST

An autonumber is a long variable. That's an integer, not a string. So it doesn't contain a dash. And after 20109 comes 20110. So it needs more than meets the eye.

You define a autonumber key. That's just a meaningless number. And you define a key as you want it. Then in the form that's being used to enter the record add a procedure that calculates and fills your own key. In fact, I've done so in an application I wrote last year at my work. Wanna buy it?

Kees

- Collapse -
Re: Re: autonumbering
Jan 14, 2011 2:18AM PST

ok thanks for the help. i'll see if i can come up with something on my own first. i think this is a little out of my league. but i'll give it a shot, thanks for the idea.