Autonumber Question

  • Thread starter Thread starter Joe Williams
  • Start date Start date
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
 
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")
 
Back
Top