Percentage Question ?

  • Thread starter Thread starter Dave Elliott
  • Start date Start date
D

Dave Elliott

I have a field that I use to calculate a percent of the amount due for the
customer. (2%)
Say the customer owes $693.05, then he would owe $13.86 interest at 2%.
I want to calculate that percentage by day instead of a flat amount.
What would be his percent owed by each day up to 59 days. Then a new rate
would be used, 3% Then after 89 days 4%.
2% from 30 days to 59 days
Right now here is my formula for the field that calculates the 2% of the
whole amount the customer owes.
=[BidA]*0.02 The name of this unbound text box is Text335
How can I do this?

Thanks,

Dave
Using Access 2002 SP3
 
=CalcInterest([BidA], [InvDate])

Public Function CalcInterest(Value As Currency, InvDate As Date) As Currency
Dim iDays As Integer
Dim sngPercent As Single

iDays = DateDiff("d", InvDate, Date)

Select Case iDays
Case Is > 89: sngPercent = 0.04
Case 60 To 89: sngPercent = 0.03
Case 30 To 59: sngPercent = 0.02
Case Is < 30: sngPercent = 0
Case Else: sngPercent = 0
End Select

CalcInterest = Value * sngPercent
End Function

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
 
Back
Top