Access combobox does not display all decimal digits if end on zero

  • Thread starter Savvoulidis Iordanis
  • Start date
S

Savvoulidis Iordanis

I use Access 2003 on XP Pro SP3.
I have a list of decimal values with 2 decimal digis, displaying in a
combobox. Why do the numbers that end with 0 in the last decimal digit (i.e.
2,30 or 3, 50) are displayed like 2,3 and 3,5 when the combobox opens?
A sample opened combobox list is like:
2,45
2,46
2,5
2,51
2,56
3,1
3,13
3,15

The problem with this, is that if I already have a value like this, selected
in the combobox, then it does not appear as selected in the opened list,
which confuses the users when they open the combobox to select the previous
or next value in the list. They have to go all the way down to find it again
and select the other one. I want 3,1 to display as 3,10 in the opened
combobox.

I believe it's an Access 2003 bug, but I'd like a comment on it.

TIA
Iordanis
 
S

Savvoulidis Iordanis

I have to mention that I use a display format of Standard with 2 decimal
digits on the form field. When I make a selection and close the combobox the
value is displayed OK. The problem arises when the combobox opens again.
Also the SQL SELECT I use is :
select dec_value from opt_values
 
J

John W. Vinson

I use Access 2003 on XP Pro SP3.
I have a list of decimal values with 2 decimal digis, displaying in a
combobox. Why do the numbers that end with 0 in the last decimal digit (i.e.
2,30 or 3, 50) are displayed like 2,3 and 3,5 when the combobox opens?
A sample opened combobox list is like:
2,45
2,46
2,5
2,51
2,56
3,1
3,13
3,15

The problem with this, is that if I already have a value like this, selected
in the combobox, then it does not appear as selected in the opened list,
which confuses the users when they open the combobox to select the previous
or next value in the list. They have to go all the way down to find it again
and select the other one. I want 3,1 to display as 3,10 in the opened
combobox.

I believe it's an Access 2003 bug, but I'd like a comment on it.

TIA
Iordanis

Try setting the Format property of the combo box to

"#,00"

If that doesn't work you may need to base the combo on a query like

SELECT fieldname, Format([fieldname], "#,00") AS showfield ORDER BY fieldname;

Set the bound column to store the actual field value, and the column widths to
conceal it and display the formatted value.
 
S

Savvoulidis Iordanis

SELECT fieldname, Format([fieldname], "#,00") AS showfield ORDER BY fieldname;

This worked. Thanks. But I still believe it's some kind of innocent bug.
Those things should be handled automatically and not by using tricks. Don't
you think?
 
B

BruceM

How is Access to know "automatically" which format you want? The decimal
equivalent for the fraction 1/16 is .0625. The decimal equivalent for 1/2
is of course .5. In many situations people would rather see .5 than .5000.
The fraction 1/11 is the repeating decimal .090909... . What should Access
do "automatically"? Two decimal places? Four? Display all decimal places
up to the most decimal places in that field, but limit repeating decimals to
six places?
The point is that any automatic choice would be based on an arbitrary rule.
Instead, Access displays the necessary decimal places, and leaves it to the
developer to select the appropriate display format. It is no bug.

Savvoulidis Iordanis said:
SELECT fieldname, Format([fieldname], "#,00") AS showfield ORDER BY
fieldname;

This worked. Thanks. But I still believe it's some kind of innocent bug.
Those things should be handled automatically and not by using tricks.
Don't
you think?
 
S

Savvoulidis Iordanis

I couldn't agree more.
But why don't the dropdown list items get the format already set for the
column itself? That's the 'innocent bug' I mean.
I think this first appeared after installing SP3 on XP, but I'm not sure to
be honest.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top