decimal control

C

clara

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
 
C

clara

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
 
O

Ofer Cohen

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
 

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