
Originally Posted by
orange
thanks - I know the about the If isnull and use it alot in my code.
But this is terms of:
Code:
Private Sub txtComAreaDecorationRenewYear_AfterUpdate()
If IsNull(txtComAreaDecorationRenewYear.Value) Then
Me.[txtComAreaDecorationRenewYear] = ""
ElseIf Me.[txtComAreaDecorationRenewYear] < Format(Date, "yyyy") Then
MsgBox "Renew Year Invalid: < Current Year!"
Me.txtComAreaDecorationRenewYear = Null
ElseIf CLng(Me.[txtComAreaDecorationRenewYear] > CLng(Format(Date, "yyyy") + 5)) Then
MsgBox "Renew Year Invalid: Exceeds Life Expectancy!"
Me.txtComAreaDecorationRenewYear = Null
End If
Me.txtComAreaDecorationRenewYear.BackColor = vbWhite
End Sub