Forum Discussion
Problem retrieving data from a form.
Thank you for your attention, sorry for the lack of clarity, I am not used to this kind of forum.
In fact, there are two problems that may be related. Here is a summary, you can do simulations with the file attached below.
- When I retrieve data from a query that is in a form, the display of that data is not correct (see the fifth image). However, the data collected is good, since calculations made with them are correct, it is only the display of the query that is in question.
- Numbers with a simple Real data type are not correct when there are decimal places. The display looks correct, but the figure used for the calculations is not good. On the other hand, at the double real type, the number displayed and the one used for the calculations are the same.
But this problem is not constant, see the sample file: https://www.dropbox.com/s/hzb22tx16h3mkmx/Database8.accdb?dl=0
Hi,
> When I retrieve data from a query that is in a form, the display of that data is not correct
Yes, that's a bug I can reproduce. There are several variants of these "Chinese" problems we've discussed over the years. I have now reported "your" 😉 variant to Microsoft. For the correct display in the query you can use a workaround with a conversion function like:
cdbl(Forms!Form1!Texte2)
The conversion functions throw an error with Null values. You can avoid that with
cdbl(nz(Forms!Form1!Texte2)) or iif(Not IsNull(Forms!Form1!Texte2), Forms!Form1!Texte2)
> Numbers with a simple Real data type are not correct when there are decimal places.
In your sample database I don't see any real errors but only the usual rounding inaccuracies with the Single data type. You should not use the Single datatype at all and certainly not for calculations when the decimal places have to be exact. Instead you have to use either Double, Currency or Decimal.
Servus
Karl
****************
Access Bug Trackers
Access News
Access DevCon