Sequential Number

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to create a work order identification code that includeds the following:

A text portion "TFO-" that will be the same for all work orders.

A portion that will identify the current year ie 2007.

And a sequential four digit number that will reset to 0001 at the beginning
of each year.
 
To return the string you want try something like,

"TFO" & Year(Date()) &
Format(Nz(DMax("Val(Right([FieldName],4))","TableName","Mid([FieldName],4,4)=Year(Date())"),0)+1,"0000")

Note: if you copy the code, make sure its in one line
 
Back
Top