
Automatically Assign Sequential Letter Values
I have created a procedure that will allow users to automatically
assign codes to a sequenced list of items. They select a start letter
and a gap for the sequencing numbers. For example, Letter: K, Gap: 5
will assign K005, K010, etc. through K995.
However, when there are more than 199 records (in the case of a gap of
5), I need for the letter to change, so the next value after K995 will
be L000. I haven't been able to accomplish this part of the
procedure.
The start letter and gap are assigned by the user through a simple
form, and I use the following code to assign the values:
Do Until rstPLISN.EOF
With rstPLISN
.Edit
!PLISN = Forms!PLISNFrm.Letter & IIf((Forms!PLISNFrm.Gap *
(rstPLISN.AbsolutePosition + 1)) Like "#", "00" & (Forms!PLISNFrm.Gap
* (rstPLISN.AbsolutePosition + 1)), _
IIf((Forms!PLISNFrm.Gap * (rstPLISN.AbsolutePosition + 1)) Like
"##", "0" & (Forms!PLISNFrm.Gap * (rstPLISN.AbsolutePosition + 1)),
(Forms!PLISNFrm.Gap * (rstPLISN.AbsolutePosition + 1))))
.UPDATE
.MoveNext
End With
Loop
Any suggestions on automatically advancing to the next letter would be
greatly appreciated.
Thanks,
..Bob