Home » Developer & Programmer » Forms » Calculations in Forms
Calculations in Forms [message #80079] Fri, 09 August 2002 09:06 Go to next message
Eddie
Messages: 23
Registered: January 2001
Junior Member
I'm having trouble doing calculations within forms. I'm trying to multiply a qty item with a price item (both in different data blocks) I also have a view with the same price and qty items in the same datablock. I want to have the product displayed along with other database records on the Form.

I've tried enabling the formular calculation mode in the property palette and entered the following formular-> :WHSSTDR.WHSSTDR_QTY * :WHSDRUG.WHSDRUG_COST
where WHSSTDR & WHSDRUG are the datablocks/underlying tables. Nothing shows up as the result/product, on the form.

I've also tried using the formular below in the view datablock:
:WHSDGVW.WHSSTDR_QTY * :WHSDGVW.WHSDRUG_COST with similar results.

I've also tried using a block-level post query trigger with the following code:
:GLOBAL.COST:= NULL;

:GLOBAL.COST:= :WHSDRVW.WHSSTDR_QTY * :WHSDRVW.WHSDRUG_COST;

and tried inserting the :GLOBAL.COST variable into the copy from value item in the property palette to no avail.

The field in which I am trying to display the product is a non-database text item. Please help.

Any help will be greatly appreciated.

Sincerely,
Eddie.
Re: Calculations in Forms [message #80087 is a reply to message #80079] Fri, 09 August 2002 21:11 Go to previous message
Subhash
Messages: 105
Registered: October 2001
Senior Member
Check whether any of the values is null. If so use 'Nvl' in the formula
Previous Topic: Re: FRM-40508 error solutions
Next Topic: How do I build a PLEASE WAIT (while busy)
Goto Forum:
  


Current Time: Sat Apr 20 02:45:02 CDT 2024