Greyowlsl
Mlak Mlak
- Local time
- Today, 18:53
- Joined
- Oct 4, 2006
- Messages
- 204
Hi,
The code below is pretty self explanatory, but i cant seem to get it to work, learning everything from access help so...
It is the datediff line which is yellow highlighted as the error.
Thanks for your time,
Leon
The code below is pretty self explanatory, but i cant seem to get it to work, learning everything from access help so...
Code:
Private Sub Form_Load()
Dim W_C As Integer
Dim W_C2 As Currency
If Me.WARRANTY_RETURNED Then
Me.warrantycontrol = "No warranty card supplied"
ElseIf Me.WARRANTY_RETURNED > "01-Jan-09" Then
W_C = 5
Else
W_C = 3
End If
W_C2 = DateDiff("yyyy", "Date recieved", (DateAdd("y", W_C, Me.WARRANTY_RETURNED)))
If W_C2 >= W_C Then
Me.warrantycontrol = "Yes"
Else: Me.warrantycontrol = "No"
End If
End Sub
It is the datediff line which is yellow highlighted as the error.
Thanks for your time,
Leon