On 12/11/2013 07:25 AM, Lelanthran Manickum wrote:
Hi all
I posted this on stackoverflow with no success; perhaps someone where can
help:
I'm using LibreOffice 4.0 + MySQL on Linux. I have a form which contains a
Table Control. This table has a column that is an integer. I would like to
have a different control on the same form that keeps a running total of the
above-mentioned integer field in the above-mentioned table control.
So far I tried using a parameterised query that gets executed in a subform
(which holds the text box control that displays the result of the query),
but this prompts me for the parameter each time I change a row in the table.
Basically the table control houses a table which is used to record
line-items on a purchase receipt. I want a separate control that displays a
running total as the user enters line-items.
Warm Regards
Lelanthran
There are things that I do not understand about your table
control. You mentioned a running total of a field, but of what is it a
running total? Do you need to use the SUM function, or would the COUNT
function work? Without knowing what is the purpose of the field, it is
hard to know how to get the information you want to appear in the form.
A query is likely what you would need to use to solve your
problem. But without knowing what fields are contained in the table
control, suggestions as to how to solve the problem are hard to make.
You will need to use a query for what you want. It will contain
your field of interest and at least another field which will limit the
query output to the rows which are of interest to you.
For example, I have a form containing the foods I eat. One table
control contains the nutitional information about the foods as well as a
field with a checkbox to select the foods I eat. I want to know the
quanity of protein, carbohydrates, and fats that I consume (one query).
In another query, I want to know what are the percentage of total
calories that I get from protein, carbohydrates, and protein. Using the
field with the checkbox, I can limit the data to the rows which have a
check. Then I can add, multiply, and divide in the query to get the
results I want.
--Dan
--
To unsubscribe e-mail to: [email protected]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted