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

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.

Hello,

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?

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 - still have not given OS or database used.

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

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.

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

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

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

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

Interestedt?

@thewop,

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.

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