Ask Your Question
0

How to (i) show (ii) record - calculated values on base form? [closed]

asked 2014-08-07 10:43:33 +0200

PChitnis gravatar image

(i) I need to show in real time the sum/ difference/ division/ product of two fields in a form (not report) for data entry as a guide/check. By the way I am using Libre Base as front end for standalone MYSQL back end.

(ii) At another place I also need to store the data into an underlying table.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-03-04 19:14:35.141343

2 Answers

Sort by » oldest newest most voted
0

answered 2014-08-07 17:14:58 +0200

doug gravatar image

Try creating an unbounded text field, not enabled, and then manipulating the value programmatically in LibreOffice Basic through macros Tools --> Macros --> Organize Macros. This will provide solution, for normal non-grid form. I think there is a bug preventing it from working on a grid (see my question).

dim val1, val2, sum1
dim frm, ofForm
frm = ThisComponent.Drawpage.Forms
ofForm = frm.getByName("MyForm")

val1 = ofForm.GetByName("num_field1").value
val2 = ofForm.GetByName("num_field2").value

sum1 = val2 + val2

ofForm.GetByName("unbound_text1").text = sum1
edit flag offensive delete link more
0

answered 2014-10-07 16:06:18 +0200

PChitnis gravatar image

Thanks Doug. It took me a little time to work on this particular problem and try it out. It works fine. A few details has to be added to meet my form requirements.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-08-07 10:43:33 +0200

Seen: 729 times

Last updated: Oct 07 '14