Numeric Field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create a numeric field, 4 digits long. This field often has figures such as 0001, 0028, 0123 etc. However, when entered into the table, the 0's preceding the following digits are dropped and it displays for instance : 1, 28 or 123! How do I force the system in my input mask to not suppress the zero's?
 
In the format field in the desigh view of the table put 4 zeros like this 0000. this works even for autonumber.
 
Best option would be to use a text field of length 4.

Useful function would be VAL.

--
Kailash Kalyani
MEA Developer Support Center
ITWorx on behalf of Microsoft EMEA GTSC

Sun said:
I am trying to create a numeric field, 4 digits long. This field often
has figures such as 0001, 0028, 0123 etc. However, when entered into the
table, the 0's preceding the following digits are dropped and it displays
for instance : 1, 28 or 123! How do I force the system in my input mask to
not suppress the zero's?
 
Actually the easiest way is to set the format property of the object!
Set it to 0000;0000;0000;0000

Hope that helps.

--
Kailash Kalyani
MEA Developer Support Center
ITWorx on behalf of Microsoft EMEA GTSC

Sun said:
I am trying to create a numeric field, 4 digits long. This field often
has figures such as 0001, 0028, 0123 etc. However, when entered into the
table, the 0's preceding the following digits are dropped and it displays
for instance : 1, 28 or 123! How do I force the system in my input mask to
not suppress the zero's?
 
I'm glad you posted a correction to this, because this certainly wouldn't be
the "best option"!
 
Sun said:
I am trying to create a numeric field, 4 digits long. This field often
has figures such as 0001, 0028, 0123 etc. However, when entered into the
table, the 0's preceding the following digits are dropped and it displays
for instance : 1, 28 or 123! How do I force the system in my input mask to
not suppress the zero's?
 
Rather than using an input mask, you should probably be using the Format
property (available anywhere you could need to display data in an Access
database). The format should be "0000". This makes the value 23 display as
0023, which is what it sounds like you want.

good luck
 
I am trying to create a numeric field, 4 digits long. This field often has figures such as 0001, 0028, 0123 etc. However, when entered into the table, the 0's preceding the following digits are dropped and it displays for instance : 1, 28 or 123! How do I force the system in my input mask to not suppress the zero's?

A Number is a number: 28, 028, and 0000000000028 are all just
different ways of depicting the same numeric value. It's not stored
with zeros (or a digit 2 or a digit 8 either) - it's stored as a
binary numeric value.

You can set the Format property of the field (or of the control in
which you're displaying the field) to 0000 to force the number to be
DISPLAYED (again, not stored) with leading zeros; or - if you will not
be doing mathematical calculations with the value - you can use a Text
field instead of a Number field, and set its Input Mask property to
0000.
 
Back
Top