Solved

RECORD LEADING zero's in a numeric field

Posted on 2006-11-02
5
685 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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 168 total points
ID: 17860886
set the field format to 0000 in table design view
0
 
LVL 9

Assisted Solution

by:dancebert
dancebert earned 166 total points
ID: 17861892
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
ID: 17862243
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

680 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