Home » Developer & Programmer » Forms » Calculation for a balance(non database item)
Calculation for a balance(non database item) [message #149065] Tue, 29 November 2005 22:42 Go to next message
robhulse
Messages: 35
Registered: November 2005
Member
Hi, im having a little trouble with a form that i am trying to create.
The form itself list a particular member of a club in one datablock and via a foreign key link it references all the lessons which that particular member has been involved in another datablock. The form displays all the relevant details plus a procedure which updates a lesson costing, which is activated when a button is pressed(just basically displaying that the procedure works.
The problem i have concerns a non database item which i am trying to use to add all that members lesson costs up into a single member balance. i have produced the following program unit:
PROCEDURE Member_balance(mem club_member.shotgun_cert_id%type) 
IS	mbalance NUMBER;
BEGIN
  SELECT SUM	(lesson_charge)
	INTO				mbalance
	FROM				lesson_schedule,club_member
	WHERE				lesson_schedule.fk1_shotgun_cert_id = mem;
	EXCEPTION
   when 
      NO_DATA_FOUND
   then
      message ('Invalid Member ID - Please re-enter');
      raise form_trigger_failure;

END;

I have also referenced this program unit via a when-validate-form trigger on the display area and set the property values of the area to number and non database item.

Can anyone help because i would love to add this finishing touch to my form?

Thanks v.much if you can:)
Re: Calculation for a balance(non database item) [message #150047 is a reply to message #149065] Tue, 06 December 2005 01:42 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have you solved your problem? What version of forms are you running? Have a look for 'Calculation Mode' in the forms help (6i or higher).

David
Previous Topic: Calling a procedure from another procedure
Next Topic: Trigger messing up my INSERTS in forms.
Goto Forum:
  


Current Time: Fri Sep 20 05:35:37 CDT 2024