Ask Your Question

Want to calculate a third field on a form during data entry.

asked 2019-07-02 23:04:53 +0100

thewop gravatar image

updated 2020-08-07 02:52:35 +0100

Alex Kemp gravatar image

Have 3 database fields: Data entry for Rent$1 & Rent$2. When entered I want to calculate & display Rent$3 on the form. Only want this to occur when entering a New record, not existing records.Version LO 6.2.4.

edit retag flag offensive close merge delete



You have not included important information - specific LO version; OS; database being used. In this case it will need specific macro coding. Are you familiar with LO macros?

Ratslinger gravatar imageRatslinger ( 2019-07-02 23:29:23 +0100 )edit

It is LO 6.2.4. No not familiar with Macros but if your interested in doing it I will pay you. I can send you the entire specs of this calculations if interested. Contact me at (deleted eMail - good for much spam) or respond on this site. Thanks

thewop gravatar imagethewop ( 2019-07-03 01:54:02 +0100 )edit

@thewop - still have not given OS or database used.

Can probably help but need your Base file. Please post sample without personal or confidential information.

Ratslinger gravatar imageRatslinger ( 2019-07-03 01:58:17 +0100 )edit

Actually I said a third field figuring if I got that response I would expand the calculation with remaining fields that need to be included. Straight forward computations but being a Newby to LO I just don't have the time to dig into right now. Let me know. Thanks.

thewop gravatar imagethewop ( 2019-07-03 01:58:41 +0100 )edit

Its on 2 platforms Mac El Capitan version 11.1.2 and Windows 10. Using Libreoffice Base. Works fine on both.

thewop gravatar imagethewop ( 2019-07-03 02:00:34 +0100 )edit

LibreOffice Base is NOT a database. It is the front end to a database. Default database can be either Firebird embedded or HSQLDB embedded.

Ratslinger gravatar imageRatslinger ( 2019-07-03 02:02:59 +0100 )edit

Developed a LO database for my daughters company just to maintain a customer base.

Has following dollar buckets:

RENTALS: Eight(8) rental buckets:  RENT#1 - RENT$8 (Charges for up to 8 rental units)
DISCOUNT: One (1) discount$ bucket (disc$)
DELIVERY:  One (1) delivery charge bucket (deliv$)
B4 TAXES:  One (1) before tax dollars ((b4_tax$ (rent$1 thru rent$8) - disc$) + deliv$))
TAXES:    :   One (1) Tax dollar bucket (b4_taxes * taxr) taxr is variaable in database
RENT$    :    One (1) Total contract charges (B4_tax$ + taxes)

ACTION: Once they enter a NEW record and get to b4_tax$ I need the computations done and all these fields automatically populated (B4_tax$, taxes, rent$). Only for NEW records.

Macro Calculation:

1. Add (RENT$1 thru RENT$8) - DISC$ + DELIV$ populating/displaying B4_TAX$.
2. Multiply B4+TAX$ * TAXR (ex: .070) populating/displaying TAXES..
3. Add B4_TAX$ + TAXES populating/displaying RENT$.

All fields are in database. Need to know how

thewop gravatar imagethewop ( 2019-07-03 02:14:43 +0100 )edit

I can email the specs if need be as the Comments have jumbled it together.

thewop gravatar imagethewop ( 2019-07-03 02:15:46 +0100 )edit


thewop gravatar imagethewop ( 2019-07-03 02:18:20 +0100 )edit

1 Answer

Sort by » oldest newest most voted

answered 2019-07-03 02:41:41 +0100

Ratslinger gravatar image


Your comment displays much difference from the original question.

Typically you do not store calculated information which can be re-calculated from existing data (done through SQL). Without knowing full background, there may be a design problem. Can't see why there are eight RENT 'Buckets'. Possibly should be in another table.

Please see my answer in this post -> Base Form data uneditable. It contains samples of the calculation using SQL and another with macros.

My initial reaction is your design is possibly flawed. Can't be certain as that requires much more info and is not what this site is for. It is to ask a question and get a response. You have not even provided the database used and that was asked for multiple times. Would be much more difficult to work on an entire process such as this.

edit flag offensive delete link more


Sorry. I figured if the two field calculation I started out with could be solved I could add the additional calculations from there. Once the code was written I could add all necessary additional calculations. Guess Ill convert to MSacess which allows me to do calculations on a screen easily. Thanks for your input and time. Tony

thewop gravatar imagethewop ( 2019-07-03 13:13:44 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-07-02 23:04:53 +0100

Seen: 57 times

Last updated: Jul 03 '19