Rounding

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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

Check the format of that text box in your form. The make sure it is a
number type that supports decimals.

As for storing the result in a table, don't. Access can re-compute it
faster than it can read it from the table.
 
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
 
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?
 
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.
 

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

Back
Top