Rounding

S

Swansie

i am using the following formuals in a form the result isnt being recorded to
a table but when it appears on the form the number is being rounded. How do
make this not happen. Width: CLng([Inches]/12) and SqFt:
CLng([width]*[feet]).... Also is there a way for the results that these
formuals give to be recorded in a table?
 
D

Douglas J Steele

Why? Storing them would actually be a violation of relational database
principals, one of which states that you should never store data which is
entirely derivable from the values of other fields in the same record.

Create a query that has those two calculations in it, and use the query
wherever you would otherwise have used the table.
 
R

Rick Gittins

You are doing the data conversion to long (CLng). Long numbers do not have
decimal points. If you change your CLng to CDbl it will your decimal
places.

Rick
 
S

Swansie

yes thats the problem thanks

Rick Gittins said:
You are doing the data conversion to long (CLng). Long numbers do not have
decimal points. If you change your CLng to CDbl it will your decimal
places.

Rick

Swansie said:
i am using the following formuals in a form the result isnt being recorded
to
a table but when it appears on the form the number is being rounded. How
do
make this not happen. Width: CLng([Inches]/12) and SqFt:
CLng([width]*[feet]).... Also is there a way for the results that these
formuals give to be recorded in a table?
 
V

Van T. Dinh

They are already Doubles.

Just get rid of CLng and check the Format Property of the Controls so show
as many decimal places as required.
 
Top