If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Rounding decimal values in forms and reports
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 #####. |
#2
|
|||
|
|||
Rounding decimal values in forms and reports
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. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "LarsM" wrote in message ... 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 #####. |
#3
|
|||
|
|||
Rounding decimal values in forms and reports
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. "Allen Browne" wrote: 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. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "LarsM" wrote in message ... 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 #####. . |
Thread Tools | |
Display Modes | |
|
|