Rounding decimal values in forms and reports

L

LarsM

Just for your information: Some months ago I asked a question about decimals
in presentation of numerical fields in forms and reports. Now I just happened
to bump into an answer myself, which seems to help me in most cases. A
numerical value (long real, double precision) has maybe 15 decimals. If the
field in the form or report isn't wide enough to show all 15 decimals, it
just shows #####. What I asked about some months ago was a method to show the
value with just as many decimals, as there is room for.

Now it seems, that if I make a calculation in a field of the select query
that the form or report is based on, and I then refer to that field in a form
or report, the field shows #####. If I make the calculation in the form or
report itself instead of making it in the select query, it seems to be
working, as I want it to work. Don't ask me why, but it seems to work! This
will help me in cases, where the value of the field is calculated only when
the form or report is opened.

In cases where the value has been calculated in advance and has been stored
in a numerical field (long real, double precision) in a table, the method
above does not help me. If the value in the table has been updated by an
update query, I have modyfied the update query, so that the update query
itself rounds the value to fewer decimals. As far as I have tested until now
it works, but I am not sure what will happen, if the update query rounds to 2
decimals, and the precision of the computer itself causes a number e.g. 4.18
to be saved as 4.180000000000001 or 4.179999999999999. In that case the value
will probably still be shown as #####.
 
A

Allen Browne

Thanks for posting the information you found.

If this is Access 2007, you have the option of showing #### or the
number-in-available-space. Click:
Office Button | Access Options | Current Database
and uncheck the box:
Check for truncated number fields.
 
L

LarsM

Yes, it is easy if you know how to do it! I actually have Access 2007, and
this is the kind of solution I was looking for some months ago without
finding it.
 

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