Stephd8459
Registered User.
- Local time
- Today, 12:51
- Joined
- Jun 29, 2010
- Messages
- 31
Hey all,
I have an odd situation with some code I have for an Alpha Numeric autonumber field
The below code looks at a field determines the highest number, which is in the last 4 positions and then returns the next value-
**** the above code had to be editted to be posted the section ("Right(code,4)" would actually have [] around the word 'code' ****
It was functioning correctly until I reloaded the table with new data.
I have been creating the db with test data, I went to my source for the actual data and after deleting the test data and adding in the actual the code does not find the highest number. There are no errors, and when I compared the steps from the old db and the new the function the same. I have checked the format on the field and find no difference. Any suggestion would be appreciated.
Thanks
Steph
I have an odd situation with some code I have for an Alpha Numeric autonumber field
The below code looks at a field determines the highest number, which is in the last 4 positions and then returns the next value-
Code:
'autonumber
Code:
[FONT=Verdana][COLOR=black]Private Sub Region_AfterUpdate()[/COLOR][/FONT]
[FONT=Verdana][COLOR=black]If Me.NewRecord Then[/COLOR][/FONT]
[FONT=Verdana][COLOR=black] Me.Code = Me.Region & Me.[PrePaid or Maintenance] & _[/COLOR][/FONT]
[FONT=Verdana][COLOR=black] Format(Val(Nz(DMax("Right(code,4)", _[/COLOR][/FONT]
[FONT=Verdana][COLOR=black] "[Support Detail]"))) + 1, "0000")[/COLOR][/FONT]
[FONT=Verdana][COLOR=black]End If[/COLOR][/FONT]
[FONT=Verdana][COLOR=black]End Sub[/COLOR][/FONT]
It was functioning correctly until I reloaded the table with new data.
I have been creating the db with test data, I went to my source for the actual data and after deleting the test data and adding in the actual the code does not find the highest number. There are no errors, and when I compared the steps from the old db and the new the function the same. I have checked the format on the field and find no difference. Any suggestion would be appreciated.
Thanks
Steph
Last edited: