rtm -God Bless you and the MsgBox() *grins!!!
I got it! Actually, I discovered that the second function was almost written correctly. When I elliminated these two lines the calculation for TotalRate was correct:
GetFourYear = CLng(tMonths)
GetFourYear = CVar(GetFourYear)
- GetFourYear = CLng(tMonths)
- GetFourYear = CVar(GetFourYear)
The problem with the last line of the GetFourYear function, though was it kept returning a date. I redefined the function As Variant instead of Date and changed the last line of the function to:
GetFourYear = CDec(TotalRate)
Finally in the GetProjectedAcrued function I changed For Case 49 To 60 to:
Case 49 To 60
GetProjectedAcrued = CVar(GetFourYear([date_of_hire])): Exit Function
- Case 49 To 60
- GetProjectedAcrued = CVar(GetFourYear([date_of_hire])): Exit Function
The only thing left to do to complete the application is to do the same thing for Case 109 To 120 for the nine year employees, but that's a no-brainer now. I completely appreciate your guiding my thought processes through this little exercise. Specifically, I'm greatful that you didn't just write the code for me and forced me to work through it. This is the first VBA application I've ever written from scratch and at the moment I'm feeling pretty good about it with much thanks to you.
Cheers!
One small last question for this line:
tMonths = (DateDiff("m", AnniversaryDate, #12/31/2004#))
for #12/31/2004# I tried to set that for just 12/31 so that it defaults to the current year, but the VB editor keeps tacking on the year 2004. I'm sure there has to be a way to do this so it doesn't have to be manually changed each year. Do you (or anyone) know how?
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.