Solved

keep trailing zeros/accept number as entered

Posted on 2004-04-01
6
535 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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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

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

Suggested Solutions

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…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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 …

896 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

15 Experts available now in Live!

Get 1:1 Help Now