Solved

ComboBox List Decimal Places

Posted on 2011-02-16
7
549 Views
Last Modified: 2013-11-28
I have a combobox on a form that is populated by running a query of a table.  I would like the decimal formatting for all to be 3 decimal places.  The issue is, when I select the drop down list from cmbHXRShellOD on the form, the decimal places are rounded up to 2 decimal places.  The formatting for the combobox, table column, and query is 3 decimal places.  For example, I have a shell OD of 8.625.  When this is populated into the combobox dropdown, it is listed as 8.63.  Then when selected from dropdown, the combobox value is 8.630.  How do I get the dropdown list to show 8.625?

Variables:
form: Heat Exchanger
combobox: cmbHXRShellOD
table: tblSSPipeSizes
query: queHXRShellOD

Formatting:
cmbHXRShellOD: Format-Fixed, Decimal Places-3, Column Count-1, Column Widths-1"
0
Comment
Question by:aftamath77
7 Comments
 
LVL 50

Expert Comment

by:Gustav Brock
ID: 34908478
In your query, retriev ShellOD as a formatted string:

ShellOD3: Format([ShellOD], "0.000")

Then use ShellOD3 in your listbox.

/gustav
0
 

Author Comment

by:aftamath77
ID: 34908664
The datasheet view of the query shows the numbers correctly formatted to 3 decimal places, ie. 8.625.  This is where the combobox is getting its list values.  But when the combobox retrieves these list values from the query, the dropdown list now shows rounded to 2 decimal places, ie 8.63.
0
 
LVL 70

Expert Comment

by:KCTS
ID: 34908756
right click on the combo box and set the format properies to FIXED, 3 decimal places
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:aftamath77
ID: 34909285
There is nothing in the menu when I right click on the combobox when looking at the form in design view.  I'm using Access 2007 if that matters.  However, in the properties panel for the combobox, the Format is fixed and Decimal places set to 3, as stated in the original paste.
0
 
LVL 50

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 34910542
> the dropdown list now shows rounded to 2 decimal places, ie 8.63.

Numeric values are converted to strings using the "fixed" format of typical two decimals and correct 4/5 rounding. Bypass this by using Format in your query as shown.

/gustav
0
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 35340065
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
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.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

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