Solved

ComboBox List Decimal Places

Posted on 2011-02-16
7
528 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 49

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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

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 49

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Question about DB Schema 27 53
Access on Mouse move 5 32
SQL Group on First occurrence 9 24
Use .MoveNext in VBA but have it filter criteria 2 12
PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
My experience with Windows 10 over a one year period and suggestions for smooth operation
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

776 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