Topic: Use database field in calculation.

I have a problem with some fields within my form.
Several fields I want to calculate but how must I do that?
Is it possible to do it in the form or is it better to save the calculation in the database.

For example I have a database with products and there is also a price_sale in this database.
This is the sales price for the product per piece. I have a sales database in which I put the quantity of the sold products.
Now I want to calculate the total price of it including VAT.

For example price per piece = 4086, I sell 10 pieces, the result must be (10 * 4086) + VAT 27% = 51892.
Also the VAT price must be calculated and stored into the database.

In the form the price per piece must be taken from the database and can not be filled in or changed in the form.
Only the quantity can be filled in and the rest must be calculated and/or stored.
Can you please help me. Thank you very much again.

Re: Use database field in calculation.

Could you not use a calculated field in the database for the total price?  This way you can enter the qty and price_sale and calculate the final price as your describing.

In the Database table you can create a new field of Calculated field type.  You should then be able to use the expression button to select the various fields from your table and add in the calculation that you require.

Let me know if this helps.

Rob

Re: Use database field in calculation.

asperen1959
Please, download en example, how to calculate on the form.
http://myvisualdatabase.com/forum/misc. … download=1

Dmitry.