A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Auto Increment by 1 Letter



 
 
Thread Tools Display Modes
  #1  
Old May 27th, 2010, 09:08 PM posted to microsoft.public.access.tablesdbdesign
Dorian
external usenet poster
 
Posts: 542
Default Auto Increment by 1 Letter

Sorry, I was assuming you knew how to write Access code.
You will need to create a VB function to perform this task.
I don't have much time now as I have to go to a meeting, look for a response
in around an hour unless someone else chimes in first...

-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".


"Cinquefoil22" wrote:

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:44 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.