keep trailing zeros/accept number as entered

Posted on 2004-04-01
Last Modified: 2008-01-09

I'm new to Access, but have not been able to find this answer anywhere.  In a data entry form, I want to be able to have the user enter any number and have Access accept the number as entered to the table.  Essentially, the problem is the trailing zeros are deleted.  I have attempted to enter ###,###.#### in the format property of the table.  Also, I can not set the default decimal places as this will vary for each number and I will need to manipulate the numbers later, so text is not an option.

0.3090 now changes to 0.309 or .309 with formating
1259.0 now changes to 1259 or 1,259 with formating

I want all numbers to appear as entered.

Question by:access-newbie
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
  • 2
  • 2
  • 2

Expert Comment

ID: 10735444
try entering ###,###.####  in the Input Mask property instead.
LVL 51

Expert Comment

by:Steve Bink
ID: 10735484
Access has its own ideas about formatting numbers, and it doesn't particularly care what the user wants.  It uses any formatting you provide as more of a 'suggestion' than a rule, in my experience.

One work around is to have the field entered as a will keep the formatting exactly as the user enters it.  The downside is you will have to account for that conversion EVERYWHERE, and it adds to the complexity of the database.  And even then, once you manipulate the numbers, Access will still have control over the format of the final result.

Author Comment

ID: 10735589
I need to keep the significant figures, entering in the input mask defeats that purpose.  If there was an easy way to deal with the text for manipulations that would work, but converting to number from text string is even more of a mess than losing the trailing zeros.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 51

Accepted Solution

Steve Bink earned 50 total points
ID: 10735758
CInt, CDec, CDbl, CCurr, etc should work fine for the conversions.  The hard part is remembering to include them everywhere.  If you are concerned about the precision of the decimals, set your number field properties to account for the highest level of precision you need (both with format and decimal places).  You may get 1.5000 instead of 1.5, but it will be ALOT easier than doing the conversions all over the place.

Why would you want each user to determine their own number format, anyways?  Creating a reporting system that does not use a standardized format is asking for trouble...

Expert Comment

ID: 10736734
you could save the number entered by your users as a text in one field and as a number in a different field.  That way, for display purposes you could use the text field and for calculation purposes you could use the number field.  If that doesn't work for you then it looks like you're up against a brick wall here friend.

Author Comment

ID: 10777013
Sorry, for not responding for so long!  I was incapacitated by the flu and it's always a pain to catch back up.  The reasoning for the formatting differences is that we are entering previously published biological data and everyone has their own way of doing things.  Also the number of significant figures gives one an idea about the accuracy of the measurements.  I really appreciate all of the help!  I just thought I was being stupid for not figuring out how to accept trailing zeros in the number fields.

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
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.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

696 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