I am having a brain lockup. I have been writing this program using alot of sql updates to make a work table. Right now I am coming into a problem with a calculation on commissions. Here is my problem. I have a commission database that salesmen recieve a commission when a payment comes in on a contract. However it is only for maybe two years of a ten year commission that they get commission. So the field CommissionRemaining, may have 20 dollars left, but the calculation on commission this period may be 50 dollars. I need to code a statement on the table that changes the commissionthis period to be only what is left. So my statement is this in pseudocode
I hope I have explained it correctly. I am assuming that because I am not using a query that I will need to link the table with a dlookup. My primary key is JOBID. This code would need to do this for all records in the table.
Thank you for any assistance with this.
Micki
Code:
If CommissionRemaining.value > CommissionEarnedThisPeriod than CommissionEarnedThisPeriod.value = CommissionEarnedThisPeriod.value Else
CommissionEarnedThisPeriod.value = CommissionRemaining.value
I hope I have explained it correctly. I am assuming that because I am not using a query that I will need to link the table with a dlookup. My primary key is JOBID. This code would need to do this for all records in the table.
Thank you for any assistance with this.
Micki