decimal issue

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
 
J

John W. Vinson

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).
 

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