Formatting a decimal

B

Beeyen

Good Day,

I have a field which has been formatted to return as a percent (coding
below). Also the field is formatted with 2 decimals. Currently, when I
enter a number such as 99.87, it returns as 99.87% and when I enter 100, it
returns 100.00%. Is there any way to have the number return with the 2
decimals as needed (98.99 as 98.99%) or if the number entered is 100 and the
decimal is not needed and the number returns 100% without the decimals?

Private Sub Review_Score_AfterUpdate()
Me!ReviewScore = Me!ReviewScore / 100
End Sub
 
J

John W. Vinson

Good Day,

I have a field which has been formatted to return as a percent (coding
below). Also the field is formatted with 2 decimals. Currently, when I
enter a number such as 99.87, it returns as 99.87% and when I enter 100, it
returns 100.00%. Is there any way to have the number return with the 2
decimals as needed (98.99 as 98.99%) or if the number entered is 100 and the
decimal is not needed and the number returns 100% without the decimals?

Private Sub Review_Score_AfterUpdate()
Me!ReviewScore = Me!ReviewScore / 100
End Sub


I don't think you can (easily) do this and still have the control editable.
The format property of a textbox is fixed, and doesn't depend on the data in
the field.
 

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