decimal control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there,

if a number is >= 100, I would like to keep decimal places equal to 1 , for
example instead of displaying 105.156, 105.2 is preferred, and when a number
is < 100, I would like to keep decimal places to 3, for example 99.675

Clara


thank you so much for your help
 
Hi Ofer Cohen, thanks you very much!

The textbox which I am going to adjust the decimal places is in group
section, i am going to use an expression such as
:=iif(avg([txtName]) > 100, round(avg([txtName]),1), round(avg([txtName]),3))
in the ControlSource property.

Clara

thank you so much for your help
 
Mybe there is a better way, but you can use code that will be located In the
OnPrint event of the section where the text box located in (UnBound text
box)

Something like
If Me.FieldNameInTable < 100 Then
Me.TextBoxNameInReport = Round(Me.FieldNameInTable , 3)
Else
Me.TextBoxNameInReport = Round(Me.FieldNameInTable , 1)
End If
 
Back
Top