To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=110323 Issue #|110323 Summary|Conversion problem in Base : variant/double to variant |/integer in FormattedField Component|Database access Version|OOO320m9 Platform|PC URL| OS/Version|Windows XP Status|UNCONFIRMED Status whiteboard| Keywords| Resolution| Issue type|DEFECT Priority|P3 Subcomponent|none Assigned to|dbaneedsconfirm Reported by|rackham
------- Additional comments from rack...@openoffice.org Mon Mar 22 20:51:01 +0000 2010 ------- Hi, In Base, I've created a Form with "FormattedField" fields. I want to use the value of a field (CAmensuel) to update the value of another field (CAannuel). I use the following macro : Sub MajCAannuel dim PysCtrlCAmensuel as object dim PysCtrlCAannuel as object PysCtrlCAmensuel = ThisComponent.DrawPage.Forms.getByName("Clients").getByName("fmtCA mensuel") PysCtrlCAannuel = ThisComponent.DrawPage.Forms.getByName("Clients").getByName("fmtCA annuel") PysCtrlCAannuel.EffectiveValue = PysCtrlCAannuel.EffectiveValue + PysCtrlCAmensuel.EffectiveValue PysCtrlCAannuel.commit End Sub If the result is a number with decimales like 123.45, the macro works well. If the result is a number like 123.00, then, the field in the Form and the column in the Table are both reset to zero at the time of the commit. The reason seems to be the following : the assignment of the result to the proprety "EffectiveValue" (variant/double) is converted to an integer (variant/integer) and placed as such in the object. I've tried to assign the result to a variable defined as double, but the problem is the same. There is a conversion to variant/integer. If I use a "NumericField" instead, the property "Value" keeps the variant/double type after the assignment and in this case, it works every time. Open the "Rackam, Macro.Base1.odb" file. Open the "Client" Form. On the 1rst record, modify the CAmensuel field with the value 10.00. Click with the mouse on the "Update record" button in the scrolling bar. It doesn't work. The field "Caannuel" is reset to zero. Repeat the operation with the value 10.05. It works. --------------------------------------------------------------------- Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@dba.openoffice.org For additional commands, e-mail: issues-h...@dba.openoffice.org --------------------------------------------------------------------- To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org For additional commands, e-mail: allbugs-h...@openoffice.org