Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help needed with running total calculation

Status
Not open for further replies.

topnotchguy

Technical User
Jan 14, 2004
10
US
Hi,

I'm a beginner using Oracle 9i Forms developer so bear with me ;-)
I'm trying to figure out a way to allow a user to see a display text item that will show a running total of the item prices selected for each item.

The user is shown a list of text box items on the webpage. The user can then click on any of the items to retrieve a drop down list of items to choose from (LOV box appears). As he selectes each item to purchase, I wanted to be able to show the user a running total in another text item box. There are about 20 items on the screen that the user can navigate to and make a selection.

This suggests that I must create a WHEN-NEW-ITEM-INSTANCE trigger for each item so that when the person clicks on the item to get the drop down list, the tigger code can update a global variable that is read by the subtotal item.

Now, I can just have a button that the user can click on that will compute the total of everything he has selected so far on the screen but I was hoping for a more elegant solution.

So my question is, do I have to write a WHEN-NEW-ITEM-INSTNCE trigger code for each item which will query the database for the associated price of the item the user selected from the LOV (a list of product names) and add this amount to a global variable that keeps track of a running total or is there an easier way to do this?

How would I display this running total in a display item box once I get the running total and make sure it gets updated every time the user navigates from one item to the next?

Any help will be greatly appreciated!

Raf
 
Well, after some diligent work over the weekend, I figured this out. If anyone is interested in the solution I came up with, let me know and I'll be happy to share it with you.

Raf
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top