Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

RECORD LEADING zero's in a numeric field

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

839 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