srinivas

  • Thread starter Thread starter Srinivas
  • Start date Start date
S

Srinivas

I have designed a form there are two fields called actual payment [AP] and
commission [comm] the scenario is like this if [AP] is from 1 to 25000 - the
bank will charge 25
as commision [comm] (THE FORMULA I WANT TO ENTER IN [COMM] and from 25001 to
50000 - 50 then after 50001 to 55000 - 55 and
55001 to 60000 - 60, 60001 to 75000, 75..........etc i want formula up
100000. But if nothing
there like 0 it should display "0"

Can any one help me please
 
Create a table (TblCommission) for your commission with the fields MinComm,
MaxComm, CommRate where you can enter eg 25001, 50000, 50 then 50001,
55000,55
In your form, in the AfterUpdate event of the AP field, use code like this

Dim MyComm as Double

MyComm = NZ(DLookup("[CommRate]","TblCommission", "[MinComm]<=" & [AP] & "
AND [MaxComm]>=" & [AP]),0)
Me.Comm = MyComm

You correctly surmised that you need to store this result in your table
because commissions can change.

Evi
 
Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
 
Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
 
Back
Top