Calculated control showing decimal places

  • Thread starter Thread starter BrianS
  • Start date Start date
B

BrianS

I have a calculated control displaying the result of a
simple calculation using the value in another control and
dividing by 86 ([Forms]![frmAnyForm]![txtBox1]/86). The
control I am displaying the result in is set to a fixed
format with 0 decimal places. The result displays
correctly in the txtbox as a whole number.

My question is, the control is not locked so that users
can manually change the value. When you click in the text
box the whole number changes to the actual calculated
number displaying up to 11 digits to the right of the
decimal. Clicking in the txtbox, it seems to lose all
formatting rules. Anyone know why this is happening and
how to fix so that if a user clicks in the box, the value
stays fixed w/no decimal value displayed? Thanks!
 
BrianS said:
I have a calculated control displaying the result of a
simple calculation using the value in another control and
dividing by 86 ([Forms]![frmAnyForm]![txtBox1]/86). The
control I am displaying the result in is set to a fixed
format with 0 decimal places. The result displays
correctly in the txtbox as a whole number.

My question is, the control is not locked so that users
can manually change the value. When you click in the text
box the whole number changes to the actual calculated
number displaying up to 11 digits to the right of the
decimal. Clicking in the txtbox, it seems to lose all
formatting rules. Anyone know why this is happening and
how to fix so that if a user clicks in the box, the value
stays fixed w/no decimal value displayed? Thanks!

That is the way the format property works. It affects the display, not the
content and the actual content is shown when you click into the field. You
would need to modify your code that inserts the value to round the result
first instead of relying on the format property.
 
Back
Top