Decimal Places Displayed in Combo Boxes (?)

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?
 
K

Ken Snell \(MVP\)

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")
 
T

tbl

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?
 
K

Ken Snell \(MVP\)

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?
 

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