If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
Auto Increment by 1 Letter
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? |
#2
|
|||
|
|||
Auto Increment by 1 Letter
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". "Cinquefoil22" wrote: 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? |
#3
|
|||
|
|||
Auto Increment by 1 Letter
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... "Dorian" wrote: 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". "Cinquefoil22" wrote: 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? |
Thread Tools | |
Display Modes | |
|
|