Hello,
This question is actually a continuation of this post > How to get selected row from table control (also: refresh the query)? .
There I presented a link to a sample which totaled selected fields. Also showed in a comment the field names of the database used and one of them is FSVALUE2
. It is a field in the table:
.
Your provided sample and question refers to this Field name but nowhere do you present your database table you are using. This is where you should be getting the name from or by examining the Columns
in the basic IDE window as shown in the previous post > oForm watch window
.
getInt() is used because the field type is an Integer
.
This is solved by replacing FSVALUE2
with the field name in the table you are using.
.
Edit:
After some time now, it occurs to me that your last post about this may have been misleading. I was under the impression you could not get the sample to work and thus getting the error. Now I am thinking you simply copied the code to your project. That is hardly ever going to work especially in Base. There are too many variations in Base such as form names, control names, table names, field names, etc.
.
When getting a macro that works already, I work at understanding the code so I can fit it into my environment. It is difficult to provide any one place for documentation. Here are some:
Links in > To learn LibreOffice Base are there introductions or tutorials?
.
and
.
Andrew Pitonyak’s OpenOffice Macro Information
and
LibreOffice 7.3 SDK API Reference
.
Using a tool such as MRI or XRay is critical for drilling into the Properties, Methods, Interfaces and Services.
.
Yes it is a lot and again, documentation is scattered and not always complete.