Then you can convert the characters to numbers using the Asc() function.
For example, Asc("A") returns 65 and Asc("Z") returns 90.
So if the current leftmost position was say "B" you can convert it to C by
x=Asc(Right(strNextNum),1)
If = 90 Then .... You have to go to the left one and change it
Else
Right(strNextNum,1) = Chr(x + 1)
--
Dave Hargis, Microsoft Access MVP
In your original example, you show going form BB to CC, but that doesn't
seem logical. However, it is your app and your rules, so I need to know how
the order actually is.
--
Dave Hargis, Microsoft Access MVP
So... don't know how I missed this but for whatever reason I missed your
reply. sorry bout that. OK... so... I'm back now and I'll stop relying on
the "notify me of replies" and just be vigilant about checking back manually.
Rules... I agree with you completely about the logic but unfortunately the
folks I'm writing this for are less than logical. Funny thing is this is for
tracking exhibits in court. The way courts do this is for exhibits
introduced by either the plaintiff in civil matters or the prosecution in
criminal matters the courts will use 1, 2, 3, etc. but for defense they use
A, B, C ... Z, AA, BB, CC ... ZZ, AAA, BBB, CCC ... ZZZ, AAAA, BBBB, etc.
Unfortunately, while I'd like to say that no case is so complex that it will
have more than a certain number of exhibits, I can't with certainty so best
would be the ability for the system to keep going infinitely. That said, if
that's insane I'm happy to stop at 6 digits deep ZZZZZZ which would break the
150 mark for exhibits (I hope we don't see cases with more than that for
defense exhibits! The reason the prosecution/plaintiffs get the numbering is
because traditionally the prosecution has the majority exhibits. At any rate
a trial with ZZZZZZ exhibits would be a sleepy trial. *GRIN* Sorry...
couldn't resist.)
I'm pretty much self taught with vba and access and I've wanted to start
playing with loops (I'm assuming that's where we're headed) so I'm really
excited (and nervous). On the other hand if looping isn't necessary, I'll be
content with whatever I learn. Thanks again for all your help.
Ariel