Numeric Field

message from =?Utf-8?B?U3Vu?= on 12 May 2004
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?
 
Kailash Kalyani replied to =?Utf-8?B?U3Vu?= on 12 May 2004
Best option would be to use a text field of length 4.

Useful function would be VAL.
 
Douglas J. Steele replied to Kailash Kalyani on 12 May 2004
I'm glad you posted a correction to this, because this certainly wouldn't be
the "best option"!
 
=?Utf-8?B?UGFuZ28=?= replied to =?Utf-8?B?U3Vu?= on 12 May 2004
In the format field in the desigh view of the table put 4 zeros like this 0000. this works even for autonumber.
 
leonel_14_fm@hotmail.com replied to =?Utf-8?B?U3Vu?= on 13 May 2004
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?
 
CharWoman replied to leonel_14_fm@hotmail.com on 13 May 2004
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

"leonel_14_fm@hotmail.com" <leonel_1989_9@hotmail.com> wrote in message
news:uANrN$POEHA.1160@TK2MSFTNGP09.phx.gbl...
 
Kailash Kalyani replied to =?Utf-8?B?U3Vu?= on 12 May 2004
Actually the easiest way is to set the format property of the object!
Set it to 0000;0000;0000;0000

Hope that helps.
 
John Vinson replied to =?Utf-8?B?U3Vu?= on 14 May 2004
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.

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
 

Archived message: Numeric Field (Microsoft Access)