| | |
|
|
|
Problem readin Numbers |
| message from John on 25 May 2004 |
my database has to be able to generate a VIN number. the
last 6 digits of that VIN is a serial number.
ex: 000083
the computer generates that fine, but when i read that
number to do multiplication to it, i can't get it to read
the zeros, it reads 83. i have to have those zeroes. i
realize that the above string as a number is 83, but i
need a autogenerated number, so as to not have the same
title VIN number. i am so frustrated!! thanks
John
|
| Joseph Meehan replied to John on 25 May 2004 |
Access looks at numbers two different ways. They can be numbers, which
you can add subtract etc. or they can be characters which it can not add
multiply etc.
Assuming they are really numbers (it seems you can perform calculations
so it would seem they are numbers) then do the math you want. As far as
Access is concerned a number 00083 is exactly the same as 83, except in one
case it has been told to display the number as "00000" format. Check out
the format property in the form, report or where ever you want to see the
leading zeros.
Now if you want to make up a VIN code like 00086SL78. You can do that
also, but it gets a little more complex and can be done several ways.
|
| John replied to Joseph Meehan on 25 May 2004 |
the
read
can be numbers, which
which it can not add
perform calculations
want. As far as
as 83, except in one
format. Check out
you want to see the
00086SL78. You can do that
several ways.
OK,
the problem is that it does display the number on the
form correct, but when i read it into VB to do the math
on the numbers is where i am not getting the zeros. that
is where i need the zeros to come. each number gets
multiplied by another number, each one of them different.
|
| Graham R Seach replied to John on 26 May 2004 |
John,
Me.txtVIN = Format(CalculatedValue, "000000")
Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
"John" <john@bondtech.net> wrote in message
news:122ae01c44276$831a9cb0$a001280a@phx.gbl...
|
| Joseph Meehan replied to John on 25 May 2004 |
Leading zeros are not part of any math function. You don't need them to
do math, like multiplied by another number
00083
X 2
|
|
Archived message: Problem readin Numbers (MS Access)