I need help with formating numbers

mrdata

Registered User.
Local time
Today, 09:59
Joined
May 26, 2006
Messages
32
Hi: I am new at this so forgive the crudity of this code.
I have a form I am trying to do calculations on I am using code to do this as follows.

Private Sub Text108_AfterUpdate()

Dim east As Single
Dim Center As Single
Dim west As Single
Dim Ans As Single

east = Text104
Center = Text106
west = Text108
Ans = east + Center + west

Text110 = Ans / 3




End Sub

Example
East=24.0
Center=25.0
West=25.3

Ans=74.3

Text110=24.76666

I want Text110 to show 24.7
 
I would dim your variables as double

The Text110 field open its properties and on the format tab you can set the number of decimal places
also set format to fixed
 
Last edited:

Users who are viewing this thread

Back
Top Bottom