Auto Increment by 1 Letter

C

Cinquefoil22

Simple question, hope I can get an answer....
Ok, I have created a table and form for our company to keep track of incoming
inventory. Being that we work with metals, each piece that comes in is
assigned
a unique 3 letter value. We started with AAA. What I need to know is once I
enter the item we are receiving is there a way for it to automatically go to
the
next sequence of letters. Example, yesterday we received in. The last
series
of letters I used was BHV. So today, when I receive in, I want the product
to
automatically be assigned BHW and then BHX and so on. After I use BHZ my
next sequence would be BIA. Ultimately when I get to BZZ, my next sequence
would be CAA and so on....
Do you think you can help me figure out how to do this?
 
C

Cinquefoil22

2007. I just can't get the module into my form...Confused as all h**l right
now...
 
D

Dorian

Its pretty easy to do. Set up a string with all letters in sequence with an
extra A at end.
Dim strAB = "A........ZA"
Then you use INSTR function (look in HELP for details) to locate the letter
and then just add 1 to position to the next one.
You will have to check when last letter goes from Z to A since that will
trigger the same logic for the second letter. Same for the second letter
changing from Z to A triggers changing the first letter.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
C

Cinquefoil22

ok, but where am i typing the string at? I think, honestly, I am just
confused all the way around on what you are telling me to do....
Sorry...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top