decimal issue

  • Thread starter Thread starter jtfalk
  • Start date Start date
J

jtfalk

Hello,

I have the following code but can not get the text box on the form to have
any decimal places. I have put in a general number and 2 decimal places in
the property area for the box but it still will not give me any it rounds to
the whole number

Private Sub Finish_OEE_Availability_AfterUpdate()
Me.Finish_OEE_Availability = (Me.Hours_Run_Finish /
Me.Planned_Run_Time_Finish)
End Sub
 
Hello,

I have the following code but can not get the text box on the form to have
any decimal places. I have put in a general number and 2 decimal places in
the property area for the box but it still will not give me any it rounds to
the whole number

Private Sub Finish_OEE_Availability_AfterUpdate()
Me.Finish_OEE_Availability = (Me.Hours_Run_Finish /
Me.Planned_Run_Time_Finish)
End Sub

The Form does not control the decimal places: the Table does. The default
Number datatype in a table field is Long Integer, and an Integer is by
definition a whole number. The Decimal Places property in the field properties
doesn't change this - it will display .00 but still be stored as a whole
number.

Change the datatype of the table field to Number... Double (to get up to 14
decimals), Decimal (set your own precision), or use a Currency datatype
instead of any sort of Number (exactly four decimals).
 
Back
Top