Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


keep trailing zeros/accept number as entered

Posted on 2004-04-01
Medium Priority
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 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.

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.
Independent Software Vendors: 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 150 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

618 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