Home » Developer & Programmer » Forms » Multiple text item problem!
Multiple text item problem! [message #222451] Sun, 04 March 2007 22:06 Go to next message
oracle06
Messages: 36
Registered: December 2005
Member
Hello All,
There are two blocks both no of item property is set 6.
In block1 a text item (named tot_amt) calculation mode has been set to formula and formula is:

nvl(toolblk.item1,0) - nvl(toolblk.item2,0) --toolblk(another(detail block))

problem:
tot_amt displays the amount corresponding that row but it displays same for all columns,when I move cursor
tot_amt chages but same for all columns.
* It should dislay the value correspondig that row not same for all.
What should I do?

Please tell me asap.
Thank You.
Re: Multiple text item problem! [message #222485 is a reply to message #222451] Mon, 05 March 2007 02:35 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It seems that you didn't do it correctly; formula column ('tot_amt' in your example) should look like this:
NVL ( :toolblk.item1, 0 ) - NVL ( :toolblk.item2, 0)
Note colon signs (:) in front of a block name.

Basically, it is a very simple task; I can't imagine what you might have done in order to NOT make it work properly.
Re: Multiple text item problem! [message #222527 is a reply to message #222451] Mon, 05 March 2007 05:20 Go to previous messageGo to next message
oracle06
Messages: 36
Registered: December 2005
Member
I am sorry Littlefoot.I have posted wrong syntax.
Code was:
ABS(NVL(:TOOL_BLK.item1,0) - NVL(:TOOL_BLK.item2,0))

now what should I do?

Thanks.

[Updated on: Mon, 05 March 2007 05:20]

Report message to a moderator

Re: Multiple text item problem! [message #222564 is a reply to message #222527] Mon, 05 March 2007 07:35 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As I've said, I can't imagine what might be wrong. Can you reproduce this behaviour writing a dummy form on Scott's schema using 'EMP' table (columns ENAME, SAL and DEPTNO)? Create a formula column; formula should be SAL - DEPTNO. See whether it works correctly or not.

If it does, apply technique you used here to your "real" form. If not, attach "Scott's" form here (so that we could test it on our Scott's schema).
Re: Multiple text item problem! [message #222681 is a reply to message #222451] Mon, 05 March 2007 22:38 Go to previous messageGo to next message
oracle06
Messages: 36
Registered: December 2005
Member
Hello,
I am attaching form(version 6i)herewith.
same problem is here.

thanks.
  • Attachment: emp_test.fmb
    (Size: 96.00KB, Downloaded 1008 times)
Re: Multiple text item problem! [message #222785 is a reply to message #222451] Tue, 06 March 2007 06:28 Go to previous messageGo to next message
bhupinderbs
Messages: 67
Registered: July 2006
Location: Bangalore
Member
Hi!!

Remove formula from column of department block
and put this in the POST_QUERY trigger

BEGIN
SELECT NVL(SUM(SALARY),0)
INTO :department.sal
FROM employees
WHERE department_id = :DEPARTMENT.DEPT_ID;
END;

Hope this will solve your problem.

Bhupinder Singh
Re: Multiple text item problem! [message #222791 is a reply to message #222681] Tue, 06 March 2007 06:42 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Seeing what you've done, it seems that this behaviour is expected. You are subtracting TOT_BAL and 10 (hard-coded). As TOT_BAL doesn't change, formula will always return the same value, no matter what stands in records contained in the 'department' block.

I changed the formula to
(abs(nvl(:employee.tot_bal,0) -:department.budget))
(note :department.budget and it returns different values for every record.
Re: Multiple text item problem! [message #222903 is a reply to message #222451] Tue, 06 March 2007 22:17 Go to previous messageGo to next message
oracle06
Messages: 36
Registered: December 2005
Member
Hello,
First of all thank you for guidence.
But problem is not of hardcoding,I want when I move cursor,
value of only current record should chnage,but right now when
I move cursor, values are changing for all records
corresponding to that perticular record where cursor points.
Re: Multiple text item problem! [message #222927 is a reply to message #222903] Wed, 07 March 2007 00:07 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
But that sounds inconsistent to me. There are several records on the screen, and you want only one (i.e. current one) to show correct value (calculated by the formula you wrote). What about the rest of the records? Which value should they show? NULL? Something different?

Let's say that now I understand what you want, but I have no idea WHY on Earth would you want to do that.

There is a way - a simple one: make the block to show only one record at a time.
Previous Topic: FRM-92101 bugging me.. please help
Next Topic: merge cells in excel using ole2
Goto Forum:
  


Current Time: Tue Dec 03 20:54:25 CST 2024