Solved

RECORD LEADING zero's in a numeric field

Posted on 2006-11-02
5
647 Views
Last Modified: 2012-08-13
I need to be able to record a number such as 0089 in numeric format in a field with in a table. each time I key in 0080 it records 80 dropping the leading zero's
the field must remain numeric please don't suggest to change to a text field
0
Comment
Question by:Jjuavinett
5 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 168 total points
Comment Utility
set the field format to 0000 in table design view
0
 
LVL 9

Assisted Solution

by:dancebert
dancebert earned 166 total points
Comment Utility
You can't store leading zeros in a numeric field.  You can, however, display a number with leading zeros.  0089 gets stored as 89.  You can display it as 0089, 89, 89.0, 89.00, etc.
0
 
LVL 35

Assisted Solution

by:Raynard7
Raynard7 earned 166 total points
Comment Utility
Hi, dancebert is correct

using format you could do

expr1: format([your field], "0000")

which would display it with four characters,

Alternativley if you are not using this as a number at all and just as a unique id you could change your field to text and put a mask on it of #### in your field to ensure only digits are placed in it.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now