URGENT! Calculation Question

StacyStacy

A "Californian" at heart!
Local time
Today, 16:29
Joined
Jan 29, 2003
Messages
159
QUESTION #1

I have 5 fields. The 5th field contains my sum.

Example: TotalFruit=Apple+Bananas+Oranges

I placed the equation in both in the AfterUpdate and Lost Focus in the field properties that I want the sum to appear.

When I first created the form and placed the formular in the field properties, the sum appeared and worked wonderfully, but has now disappeared. Nothting has changed.

QUESTION #2
I cannot get a field to show 34.05%. I have specified that this field should show in "percent" and has "2 decimal places" in the table properties. In the form, it shows fine, but it seems as though it is rounding off the numbers in which I don't want that to happen. Example 34.00%

Please help. I'm under the gun. ;) Thanks.
 
Last edited:
Answer to Question #1:
Each field has to have a value, even if it is '0'.

I still need help on Question #2.

Thanks,
 
Change the data type to single or double, and you shouldn't be storing a calculated field
 
Answer to Question #2:

Under the Table Properties, you need to specify "double" instead of "percent". The value will now show: 34.05%
 
Thanks Rich. I did not see your reply until after I posted my reply.
;)
 
I still have a problem: After I changed the properties on the table level for that field, 'double' and 'decimal = 2', when I get to my form, it still rounds out to a whole number. Also, I did not understand storing a calculated field. How would I get an answer to an equation back if I did not store a calculation in the field on the form. Please clarify.
 
StacyStacy said:
How would I get an answer to an equation back if I did not store a calculation in the field on the form.

Do it in a query, on a form, or in a report. If you had two textboxes (txtFive and txtTen on your form with 5 and 10 as their respective values and you needed the calculated value then you'd have another textbox on your form with it's ControlSource set to =[txtFive] + [txtTen]
 
Hi Mile:

Stacy isn't storing the answer but isn't articulating her question properly. Whe has 2 fields (text5 and text10) which are stored in a table and another textbox (text15) which performs the calculation of =[text5]/[text10]/ This should display the percentage result. The result does not get stored in any table.
 

Users who are viewing this thread

Back
Top Bottom