Decimal Places Displayed in Combo Boxes (?)

  • Thread starter Thread starter tbl
  • Start date Start date
T

tbl

In an Access 2000 mdb, I have several combo-boxes that
refuse to follow my instructions to display 0 places to the
right of the decimal point. They all display 2 places. Very
distracting for the data that will be entered and reviewed.
I have set the format to "fixed", and decimal places to "0",
but to no avail.

Most of them have three fields, and the displayed field is
not the PK.

Anyone here know the trick for this?
 
You need to set the format in the query that is used as the RowSource by the
combo box. Replace the actual fields with calculated fields, and use an
expression in the calculated field to give you the desired zero decimal
places:

CalcdField: Round([RealFieldName], 0)

or if you want to truncate and not round:

CalcdField: Int([RealFieldName])

or

CalcdField: Format([RealFieldName], "0")
 
You need to set the format in the query that is used as the RowSource by the
combo box. Replace the actual fields with calculated fields, and use an
expression in the calculated field to give you the desired zero decimal
places:

CalcdField: Round([RealFieldName], 0)

or if you want to truncate and not round:

CalcdField: Int([RealFieldName])

or

CalcdField: Format([RealFieldName], "0")


Thanks Ken!

Are these calculated query fields ok for data entry (thru
the form) also?
 
No, a calculated field cannot be used for editing/entering data -- they are
just "displays" of a value and are not bound to any field in a source table.
You'll need to include the actual field in the form's RecordSource query and
then bind a control to it on the data entry form.

--

Ken Snell
<MS ACCESS MVP>

tbl said:
You need to set the format in the query that is used as the RowSource by
the
combo box. Replace the actual fields with calculated fields, and use an
expression in the calculated field to give you the desired zero decimal
places:

CalcdField: Round([RealFieldName], 0)

or if you want to truncate and not round:

CalcdField: Int([RealFieldName])

or

CalcdField: Format([RealFieldName], "0")


Thanks Ken!

Are these calculated query fields ok for data entry (thru
the form) also?
 
Back
Top