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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help please 2

Status
Not open for further replies.

TTThio

Programmer
May 3, 2001
185
US
Hi again,

I try to reformulate my question, hope it will be better
(if anybody know how to cancel my previous thread, too...)

I have a form with subform. The data displayed in the subform is based on the selected two combo boxes value in the main form. For exp. I select "Alex" (by Name) and "March" (by Period) then the subform will display all the deals gained by Alex in March.
Inside the subform, there's amount of each deal. This amount needs to be added cumulatively to further calculate the commission for each deal. That's why I need the amount of previous deal to be added with the amount of the current deal = cummulative deal revenue.
For instance, deal 1 = $ 1,000. Cummulative Revenue = $1,000.
Deal 2 = $ 2,000 then cumm. rev = $ 1,000 + $ 2,000 , and etc.

The problem is deal no.1 by Alex is indexed as 3, and deal no.2 by Alex is indexed as 5 becaused index no.4 is someone else' deal.
How to refer to the previous deal amount in this case?
If I use Dlookup, in the criteria (where condition) I cannot apply {ID]-1, as it will refer to one index before for all the deals records instead of one index before for one person deals.

Please help.... thanks....
 
Hi tintinthio
This makes more sense than your first question. What is the RecordSource of the subform? If it is a query based on name=Alex and period=March, then all the records referenced by the subform will be Alex's.

Marty
 
Hi Marty,

thanks for the reply. Yet, my problem is dealing with showing previous record value in the subform.
The records displayed are already referenced by Name and Period, and it shows current records within the month.
My question is for example

Company Current Previous Cummulative
Deal A $ 1,000 0 $1,000
Deal B $ 2,500 $1,000 $3,500, etc

I currently enter the Previous value manually, I need it to be automated, and failed using DLookup function.

Anyway, I've already red flag this thread and have a new one today. If you can help me, please reply on that thread.

Tin Tin
 
I have a database that uses DSum and multiple criteria which is very similar to your situation. With adaptation it would work for you. I can forward it on to you if you provide your email address.

Joe Miller
joe.miller@flotech.net
 
Joe,

thanks a lot for the sample1.mdb.
It's great, it does solves my problem!

Tin Tin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top