Home » Developer & Programmer » Forms » calculate items outside database
calculate items outside database [message #348005] Mon, 15 September 2008 06:49 Go to next message
maher534510
Messages: 25
Registered: September 2008
Location: jordan
Junior Member
i have data block with table on a form
1- item of table is value of rent
2- item of table is parts of value
3- item of table is reminder
i was calculate the sum of first item ( value of rent)
and second item (parts of value)
this two items are database items but the third ( balance )
is not database item and in another block but at the same form

i want to enter the sum of 1 + 2 in 3
HOW ????????????
Re: calculate items outside database [message #348013 is a reply to message #348005] Mon, 15 September 2008 07:03 Go to previous messageGo to next message
rajy_salim
Messages: 204
Registered: January 2008
Location: Beirut - Lebanon
Senior Member
Then put: 3 = 2 + 1
or calculate the sum of 1 and 2 and put it in 3 since I couldn't find any 'balance' in your post. Razz

Briefly, you may calculate the sum in the WHEN-VALIDATE-ITEM triggers of the items 1 and 2, and assign the value to 3.
In the other hand, since 3 is not a database item, you may calculate it in the POST-QUERY trigger of the data block containing 1 and 2, so the value is retrieved in case you are executing query over the data block.

Rajy-
Re: calculate items outside database [message #348021 is a reply to message #348013] Mon, 15 September 2008 07:17 Go to previous messageGo to next message
maher534510
Messages: 25
Registered: September 2008
Location: jordan
Junior Member
i know but i want the code because iam beginner
Re: calculate items outside database [message #348025 is a reply to message #348013] Mon, 15 September 2008 07:37 Go to previous messageGo to next message
rajy_salim
Messages: 204
Registered: January 2008
Location: Beirut - Lebanon
Senior Member
begin
:block_name1.3 := nvl(:block_name2.2,0) + nvl(:block_name2.1,0);
end;

Where:
  • block_name1 is the data block containing the item 3
  • block_name2 is the data block containing 1 and 2
Re: calculate items outside database [message #348033 is a reply to message #348005] Mon, 15 September 2008 08:08 Go to previous message
maher534510
Messages: 25
Registered: September 2008
Location: jordan
Junior Member
thank you very much for you'r help to me
you'r code succeed
thaaaaaaaaaaaaaaaaaaaaaaaanks
Previous Topic: CALCULATION
Next Topic: Acknowledgement Bar
Goto Forum:
  


Current Time: Tue Dec 06 00:26:28 CST 2016

Total time taken to generate the page: 0.11211 seconds