How do I make changes retroactive?

D

Dedren

I recently came up with a new number scheme that is automatically created
when the form my department uses is "dirtied". Problem is it starts from the
begining of the scheme even though I have 100s of records before it was
created. It is already part of the form but it only starts where new records
were created. Is there any way I can make it start numbering from the first
record?

Thank you in advance.
 
D

Dedren

No, autonumber couldn't do this. The number looks like this: 05-123
05 is the current year based on system time, and the 123 is just incremental
to ensure no repeat numbers. Curently it starts at 05-000 then 05-001 but
only of new records not previously created ones.
 
D

Dedren

Your right, but I was advised time and time again not to do that. Here is
the code I used to make this number:

If Me.NewRecord Then
Dim strWhere As String
Dim varResult As Variant

strWhere = "ID Like """ & Format(Date, "yy") & "*"""
varResult = DMax("ID", "CASE", strWhere)

If IsNull(varResult) Then
Me.ID = Format(Date, "yy") & "-001"
Else
Me.ID = Left(varResult, 3) & _
Format(Val(Right(varResult, 3)) + 1, "000")
End If
End If
 
Top