Autonumber Question

J

Joe Williams

I would like my autonumber sequence to be the last two digits of the year,
followed by a dash and a four digit incremental string (ex 03-0001, 03-0002,
03-0003, etc)

What would be the proper code to put in the autonumber format column of the
table design view to make this happen? THanks

- joe
 
K

Ken Snell

None. An Autonumber field cannot contain characters that are inconsistent
with a Long Integer format.

And, it's not good to use the Autonumber value as a meaningful number
anyway. Create a field that will contain the "meaningful" value, and then
put the desired value into that field when you create a new record.

For your example, I would not combine the values the way you want. I would
have two separate fields: YearNum and SeqNum. You can more easily
manipulate and identify the next number in the sequence if you keep the
SeqNum field totally numeric. Then, on your forms and reports, you can use a
control that concatenates the two values to display them the way you
want....such as using a control source similar to this:
= Format([YearNum], "00") & "-" & Format([SeqNum], "0000")
 

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