Charles,
To begin with, let's get things straight: the autonumber field type is one
with its own personality, which you cannot do much on (other than just
select a display format, or thick it to a specific starting value).
Basically, it will just be incrementing or random integer values (long
integer data type), and there's no way to change this.
What you are after is not an autonumber, it is actually not even a number!
It's a structured text field. In order to get it to auto-calculate, you need
to employ a data entry form for manual entry, or an append macro for
uploaded data, in which the field value is calculated by a (scary?)
expression like:
=Right(Year(Date()),1) & Format(Date()-DateSerial(Year(Date()),1,1)+1,"000")
& "-" &
Format(Val(Right(Nz(DMax("[FieldName]","TableName","Left([FieldName],4)=Righ
t(Year(Date()),1) &
Format(Date()-DateSerial(Year(Date()),1,1)+1,"000")"),"00"),2)+1,"00")
Where you neet to change FieldName and TableName to the actual ones.
Better yet, use a function in code to calculate it:
Function Get_Key()
vYear = Right(Year(Date()),1)
vDay = Format(Date()-DateSerial(Year(Date()),1,1)+1,"000")
vLast = Val(Right(DMax("[FieldName]","TableName","Left([FieldName],4)= '
" & vYear & vDay & " ' "),2))
Get_Key = vYear & vDay & "-" & Format(Nz(vLast,0),"00")
End Function
HTH,
Nikos