Solved

keep trailing zeros/accept number as entered

Posted on 2004-04-01
6
533 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
  • 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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

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…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

708 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

16 Experts available now in Live!

Get 1:1 Help Now