VBA to Increment Revision Letters (Access 2000)
Posted on 2005-03-10
I'm looking for some bullet proof code to increment document (Generic Traveler) revision letters. The database generates the letters and stores them as a string in a text field. Right now I've got the capability of a one letter revisions. For example, document 123 goes from rev A to rev B then rev C up to rev Z. My code can't handle going beyond Z and of course now (after the DB has been used for 8 years) it needs to. My simple code is:
If rstTraveler.EOF Then
Forms![Generic Traveler Form]!txtTravelerRev = "A"
'Increment Rev Letter
intRev = Asc(rstTraveler![Traveler Rev]) + 1
strRev = Chr(intRev)
Forms![Generic Traveler Form]!txtTravelerRev = strRev
I need to be able to generate rev letters beyond Z and I'm think maybe Z, AA, BB...ZZ, AAA, BBB, ZZZ, etc.
Anyone have anything that does something like this.