Solved

keep trailing zeros/accept number as entered

Posted on 2004-04-01
6
538 Views
Last Modified: 2008-01-09
Hi,

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.

Example:
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.

Thanks!
0
Comment
Question by:access-newbie
[X]
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
6 Comments
 
LVL 8

Expert Comment

by:dds110
ID: 10735444
try entering ###,###.####  in the Input Mask property instead.
0
 
LVL 50

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 string...it 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.
0
 

Author Comment

by:access-newbie
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.
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 50

Accepted Solution

by:
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...
0
 
LVL 8

Expert Comment

by:dds110
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.
0
 

Author Comment

by:access-newbie
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.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
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…

726 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