now how can i use the switch statement because i wanted my number to be concatenated by the year as it is here.
'If Me!Account = "" Then
Select Case maxcode
Case 0 To 9
Me!ACCOUNT = Right(str(Year(Now)), 2) + "-0000" + Trim(str$(maxcode))
Me!ADMNO = Right(str(Year(Now)), 2) + "-0000" + Trim(str$(maxcode))
'Me!Account = "06-0000" + Trim(Str$(maxcode))
Case 10 To 99
Me!ACCOUNT = Right(str(Year(Now)), 2) + "-000" + Trim(str$(maxcode))
Me!ADMNO = Right(str(Year(Now)), 2) + "-000" + Trim(str$(maxcode))
'Me!Account = "06-000" + Trim(Str$(maxcode))
Case 100 To 999
Me!ACCOUNT = Right(str(Year(Now)), 2) + "-00" + Trim(str$(maxcode))
Me!ADMNO = Right(str(Year(Now)), 2) + "-00" + Trim(str$(maxcode))
'Me!Account = "06-00" + Trim(Str$(maxcode))
Case 1000 To 9999
Me!ACCOUNT = Right(str(Year(Now)), 2) + "-0" + Trim(str$(maxcode))
Me!ADMNO = Right(str(Year(Now)), 2) + "-0" + Trim(str$(maxcode))
'Me!Account = "06-0" + Trim(Str$(maxcode))
Case Else
Me!ACCOUNT = Right(str(Year(Now)), 2) + "-" + Trim(str$(maxcode))
Me!ADMNO = Right(str(Year(Now)), 2) + "-" + Trim(str$(maxcode))
'Me!Account = "06-" + Trim(Str$(maxcode))
End Select