From: BruceM via AccessMonster.com on
I replied about 11 hours before you made this posting. Aside from the issues
raised here, if the first two digits are always the same you can just append
them before the incremented number for display purposes. If they are
intended to represent the year you need to make provisions to change the
leading numbers next year, and (presumably) to restart the incrementing
numbers at the desired value. Your code as written in the original thread
will do neither that I can see.

Wes wrote:
>has anybody had a chance to take a look at my posting on 3/19 at 8:13 P.M.
>
>I find it strange that I get a space added to my variable
>
>After retrieving the highest key, I pick up the last 4 characters and add 1
>
>intNewKey = Int(Mid(strMax, 3, 4)) + 1 ' pick up the last 4 bytes and
>increment
>
>[ IntNewkey 1003 ]
>
>I then have to convert it back to a string to create the new key
>
>strNewKey = Str(intNewKey) ' cast to string
>
>when I do, the variabel has a blank placed in the first position
>
>[ StrNewKey " 1003" Notice the leading space ]
>
>Is there something I am doing incorrectly here, is this the way it is
>supposed to work?
>
>I have done some research and a lot of testing, and it always appears to
>work like this.
>
>thanks
>
>Wes

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-gettingstarted/201003/1

First  |  Prev  | 
Pages: 1 2
Prev: Access 2007 - Select Max
Next: Problem Generating Key