Private Sub Form_Load()
Dim W_C As Integer
Dim W_C2 As Integer
Dim D_Y As Integer
Dim D_A As Date
If (Me.[PRODUCT ID] = "PVE1200") Or (Me.[PRODUCT ID] = "PVE2500") Then
Else: GoTo NO_PVE
End If
If (IsNull(Me.[WARRANTY RETURNED])) Or (Me.[WARRANTY RETURNED] = "") Then
GoTo NO_CARD
End If
''Warranty extention check
If Me.[WARRANTY RETURNED] <= #1/1/2009# Then
W_C = 3
Else
W_C = 5
End If
D_A = DateAdd("yyyy", W_C, Me.[WARRANTY RETURNED])
D_Y = DateDiff("yyyy", D_A, [Date recieved])
If D_Y >= 1 Then
GoTo NO_W
ElseIf D_Y = 0 Then
GoTo MONTH_C
Else: GoTo YES_W
End If
MONTH_C:
'' Month check with 1 month date leniency
W_C2 = DateDiff("m", D_A, [Date recieved])
If (W_C2 >= 0) Or (W_C2 = -1) Then
GoTo NO_W
Else: GoTo YES_W
End If
NO_PVE:
Me.warrantycontrol = "Non PVE"
Exit Sub
NO_CARD:
Me.warrantycontrol = "No card"
Exit Sub
NO_W:
Me.warrantycontrol = "No"
Exit Sub
YES_W:
Me.warrantycontrol = "Yes"
End Sub