Okay, I've got a better one for you that DOES work when I give it dates either in December or November (since we're talking about computing out to two months in the future):
Code:
Private Sub First_ISP_AfterUpdate()
'Calculating the third Friday of the month following the month of the first ISP. If,Then statements used to cover potential change in years.
If Month(Me.First_ISP.Value) = 12 Then
Me.Second_ISP.Value = DayInMonth(3, vbFriday, 1, Year(Me.First_ISP.Value) + 1)
ElseIf Month(Me.First_ISP.Value) < 12 Then
Me.Second_ISP.Value = DayInMonth(3, vbFriday, Month(Me.First_ISP.Value) + 1, Year(Me.First_ISP.Value))
End If
'Calculating the date of the third ISP from the date of the second
If Month(Me.Second_ISP.Value) = 12 Then
Me.Third_ISP.Value = DayInMonth(3, vbFriday, 1, Year(Me.Second_ISP.Value) + 1)
ElseIf Month(Me.Second_ISP.Value) < 12 Then
Me.Third_ISP.Value = DayInMonth(3, vbFriday, Month(Me.Second_ISP.Value) + 1, Year(Me.Second_ISP.Value))
End If
End Sub
I don't know if anyone else is interested in stuff like this but I was pretty happy when I got this working so hopefully it will help someone else too.
Ps. To avoid confusion all ISP terms refer to dates of payment for Internship Support Payments (hence ISP).