I have a database that has a main form, and a sub-form (Service Contracts). The sub-form is filled in from a table based upon the property that is shown in the main form.
I would like to generate a message based upon one of the fields being loaded in the sub-form. That field is "End Date".
The bases for opening the message is that the "End Date" of the form record is less than the current Date.
The message is "The Service Contract Has Expired."
I have tried entering code in the "On Load" property of both the main form and the sub-form, to no avail.
The code I have tried is:
Private Sub Form_Load()
If "EndDate" < Date Then
MsgBox "Service Contract Has Expired"
End If
End Sub
Any help would be appreciated. Thank you.