Problem retrieving data from a form.

Copper Contributor

Hi, I have a problem when I retrieve data from a form. When it is text, no problem, but if they are numbers then it gets complicated.

 

Here is the table with the configuration of numeric fields:

 

Cobrakhan_0-1684926753649.png

 

Select query: The data appears correctly.

Cobrakhan_1-1684926753651.png

 

Form based on Query1: The data appears correctly.

 

Cobrakhan_2-1684926753651.png


Query2 that retrieves form data: In my actual project, the form is composed of independent controls.

 

Cobrakhan_3-1684926753651.png

 

Once the query is executed:

 

Cobrakhan_4-1684926753652.png

 

The decimal numbers appear in Asian characters (Expr1 and Expr2), the whole number does not appear (Expr3) but the calculations are done. In addition, when the decimal number is in simple real numeric, the number used for calculations is not correct, but correct in double real.

 

My system is in French (Canada), I changed Windows and Office to English (Canada), same result.

 

Does anyone understand what is going on? (Settings in Access, system configuration (Windows 11), bug in Access, processor compatibility (AMD Ryzen 9 5900X),??????.). I've tried a lot of things, but now I'm in the fog.

4 Replies

Hi,

 

I think that you have not received any answers so far because your problem situation is unclear.

 

The most efficient thing with this kind of problem usually is to make a tiny version of the database reduced to the problematic objects with some data available for download somewhere, in which one can test or reproduce the problem.

 

Servus
Karl
****************

Access Bug Trackers

Access News
Access DevCon

@Karl Donaubauer 

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