It works fine for anything prior to current year - flags up < Current Year.
But lets you enter anything from 2011 to infinate without error.
Yep renamed:
Code:
Private Sub EntranceDoorsFlatsRenewYear_AfterUpdate()
Dim vEntranceDoors
Dim vCompareDate
vCompareDate = DatePart("yyyy", Date) + 20
vEntranceDoors = [EntranceDoorsFlatsRenewYear]
If vEntranceDoors < Format(Date, "yyyy") Then
MsgBox "Renew Year Invalid: < Current Year!"
End If
If DatePart("yyyy", vEntranceDoors) >= vCompareDate Then
MsgBox "Renew Year Invalid: Exceeds Life Expectancy!"
End If
End Sub