I have a key that the user enters and then I want to manipulate. The
user enters a 4 digit number (X), and I run my equation on it (let's
say, X*2) and return back a 4 digit number. What the number is
doesn't really matter, as long as it is consistant each time the user
enters the same number, and as long as it is exactly 4 digits long.
So basically, I need a way to truncate integers. how do i say take 4
digits from (X*2) ?
Thanks
Arvin Meyer [MVP] - 06 May 2007 16:02 GMT
It would depend upon which 4 digits you wanted. You can get the left 4:
Left(x*2,4)
or the right 4:
Right(x*2,4)
If you need them to be a number instead of a string, just convert it back:
CInt(Right(x*2,4))

Signature
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
>I have a key that the user enters and then I want to manipulate. The
> user enters a 4 digit number (X), and I run my equation on it (let's
[quoted text clipped - 6 lines]
>
> Thanks
mpfohl@hotmail.com - 06 May 2007 21:36 GMT